Non-volatile memory and method with improved indexing for scratch pad and update blocks

ABSTRACT

Update data to a non-volatile memory may be recorded in at least two interleaving streams such as either into an update block or a scratch pad block depending on a predetermined condition. The scratch pad block is used to buffered update data that are ultimately destined for the update block. In a preferred embodiment, an index of the data stored in the scratch pad block as well that stored in the update block is saved in an unused portion of the scratch pad block every time the scratch pad block is written to.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a continuation-in-part of U.S. patent applicationSer. No. 11/016,285, filed on Dec. 16, 2004.

BACKGROUND OF THE INVENTION

This invention relates generally to the operation of non-volatile flashmemory systems, and, more specifically, to more efficient methods ofprogramming data within a non-volatile flash memory.

There are many commercially successful non-volatile memory productsbeing used today, particularly in the form of small form factor cards,which employ an array of flash EEPROM (Electrically Erasable andProgrammable Read Only Memory) cells formed on one or more integratedcircuit chips. A memory controller, usually but not necessarily on aseparate integrated circuit chip, interfaces with a host to which thecard is removably connected and controls operation of the memory arraywithin the card. Such a controller typically includes a microprocessor,some non-volatile read-only-memory (ROM), a volatilerandom-access-memory (RAM) and one or more special circuits such as onethat calculates an error-correction-code (ECC) from data as they passthrough the controller during the programming and reading of data. Someof the commercially available cards are CompactFlash™ (CF) cards,MultiMedia cards (MMC), Secure Digital (SD) cards, personnel tags(P-Tag) and Memory Stick cards. Hosts include personal computers,notebook computers, personal digital assistants (PDAs), various datacommunication devices, digital cameras, cellular telephones, portableaudio players, automobile sound systems, and similar types of equipment.In some systems, a removable card does not include a controller and thehost controls operation of the memory array in the card. Examples ofthis type of memory system include Smart Media cards and xD cards. Thus,control of the memory array may be achieved by software on a controllerin the card or by control software in the host. Besides the memory cardimplementation, this type of memory can alternatively be embedded intovarious types of host systems. In both removable and embeddedapplications, host data may be stored in the memory array according to astorage scheme implemented by memory control software.

Two general memory cell array architectures have found commercialapplication, NOR and NAND. In a typical NOR array, memory cells areconnected between adjacent bit line source and drain diffusions thatextend in a column direction with control gates connected to word linesextending along rows of cells. A memory cell includes at least onestorage element positioned over at least a portion of the cell channelregion between the source and drain. A programmed level of charge on thestorage elements thus controls an operating characteristic of the cells,which can then be read by applying appropriate voltages to the addressedmemory cells. Examples of such cells, their uses in memory systems andmethods of manufacturing them are given in U.S. Pat. Nos. 5,070,032,5,095,344, 5,313,421, 5,315,541, 5,343,063, 5,661,053 and 6,222,762.These patents, along with all other patents and patent applicationsreferenced in this application are hereby incorporated by reference intheir entirety.

The NAND array utilizes series strings of more than two memory cells,such as 16 or 32, connected along with one or more select transistorsbetween individual bit lines and a reference potential to form columnsof cells. Word lines extend across cells within a large number of thesecolumns. An individual cell within a column is read and verified duringprogramming by causing the remaining cells in the string to be turned onhard so that the current flowing through a string is dependent upon thelevel of charge stored in the addressed cell. Examples of NANDarchitecture arrays and their operation as part of a memory system arefound in U.S. Pat. Nos. 5,570,315, 5,774,397, 6,046,935, and 6,522,580.

The charge storage elements of current flash EEPROM arrays, as discussedin the foregoing referenced patents, are most commonly electricallyconductive floating gates, typically formed from conductively dopedpolysilicon material. An alternate type of memory cell useful in flashEEPROM systems utilizes a non-conductive dielectric material in place ofthe conductive floating gate to store charge in a non-volatile manner. Atriple layer dielectric formed of silicon oxide, silicon nitride andsilicon oxide (ONO) is sandwiched between a conductive control gate anda surface of a semi-conductive substrate above the memory cell channel.The cell is programmed by injecting electrons from the cell channel intothe nitride, where they are trapped and stored in a limited region, anderased by injecting hot holes into the nitride. Several specific cellstructures and arrays employing dielectric storage elements and aredescribed in United States patent application publication no.2003/0109093 of Harari et al.

As in most all integrated circuit applications, the pressure to shrinkthe silicon substrate area required to implement some integrated circuitfunction also exists with flash EEPROM memory cell arrays. It iscontinually desired to increase the amount of digital data that can bestored in a given area of a silicon substrate, in order to increase thestorage capacity of a given size memory card and other types ofpackages, or to both increase capacity and decrease size. One way toincrease the storage density of data is to store more than one bit ofdata per memory cell and/or per storage unit or element. This isaccomplished by dividing a window of a storage element charge levelvoltage range into more than two states. The use of four such statesallows each cell to store two bits of data, eight states stores threebits of data per storage element, and so on. Multiple state flash EEPROMstructures using floating gates and their operation are described inU.S. Pat. Nos. 5,043,940 and 5,172,338, and for structures usingdielectric floating gates in aforementioned United States patentapplication publication no. 2003/0109093. Selected portions of amulti-state memory cell array may also be operated in two states(binary) for various reasons, in a manner described in U.S. Pat. Nos.5,930,167 and 6,456,528, which patents, along with all patents andpatent applications cited in this application, are hereby incorporatedby reference in their entirety.

Memory cells of a typical flash EEPROM array are divided into discreteblocks of cells that are erased together (an erase block). That is, theerase block is the erase unit, a minimum number of cells that aresimultaneously erasable. Each erase block typically stores one or morepages of data, the page being the minimum unit of programming andreading, although more than one page may be programmed or read inparallel in different sub-arrays or planes. Each page typically storesone or more sectors of data, the size of the sector being defined by thehost system. An example sector includes 512 bytes of user data,following a standard established with magnetic disk drives, plus somenumber of bytes of overhead information about the user data and/or theerase block in which they are stored. Such memories are typicallyconfigured with 16, 32 or more pages within each erase block, and eachpage stores one or just a few host sectors of data.

In order to increase the degree of parallelism during programming userdata into the memory array and read user data from it, the array istypically divided into sub-arrays, commonly referred to as planes, whichcontain their own data registers and other circuits to allow paralleloperation such that sectors of data may be programmed to or read fromeach of several or all the planes simultaneously. An array on a singleintegrated circuit may be physically divided into planes, or each planemay be formed from a separate one or more integrated circuit chips.Examples of such a memory implementation are described in U.S. Pat. Nos.5,798,968 and 5,890,192.

To further efficiently manage the memory, erase blocks may be linkedtogether to form virtual blocks or metablocks. That is, each metablockis defined to include one erase block from each plane. Use of themetablock is described in U.S. Pat. No. 6,763,424. The metablock isidentified by a host logical block address as a destination forprogramming and reading data. Similarly, all erase blocks of a metablockare erased together. A metablock may be programmed in a unit of ametapage that comprises one page from each erase block in a metablock.The controller in a memory system operated with such large blocks and/ormetablocks performs a number of functions including the translationbetween logical block addresses (LBAs) received from a host, andphysical block numbers (PBNs) within the memory cell array. Individualpages within erase blocks are typically identified by offsets within theblock address. Address translation often involves use of intermediateterms of a logical block number (LBN) and logical page. In a memorysystem using metablocks, the metablock may be the effective minimum unitof erase of the memory array. Thus, the minimum unit of erase (a block)may be either an erase block or a metablock depending on the memoryarchitecture. The term “block” may refer to either an erase block or ametablock depending on the architecture. Similarly, the term “page” mayrefer to the minimum unit of programming of the memory system. This maybe a page within a single erase block or may be a metapage that extendsacross several erase blocks depending on the architecture of the memorysystem.

Data stored in a metablock are often updated, the likelihood of updatesincreases as the data capacity of the metablock increases. Updatedsectors of one metablock are normally written to another metablock. Theunchanged sectors are usually also copied from the original to the newmetablock, as part of the same programming operation, to consolidate thedata. Alternatively, the unchanged data may remain in the originalmetablock until later consolidation with the updated data into a singlemetablock again. Operations to consolidate current data to a new blockand erase a block containing only obsolete data are generally referredto as “garbage collection” operations.

It is common to operate large block or metablock systems with some extrablocks maintained in an erased block pool. When one or more pages ofdata less than the capacity of a block are being updated, it is typicalto write the updated pages to an erased block from the pool and thencopy data of the unchanged pages from the original block to erase poolblock. Variations of this technique are described in aforementioned U.S.Pat. No. 6,763,424. Over time, as a result of host data files beingre-written and updated, many blocks can end up with a relatively fewnumber of its pages containing valid data and remaining pages containingdata that is no longer current. In order to be able to efficiently usethe data storage capacity of the array, logically related data pages ofvalid data are from time-to-time gathered together from fragments amongmultiple blocks and consolidated together into a fewer number of blocks.This process is commonly termed “garbage collection.”

In some memory systems, the physical memory cells are also grouped intotwo or more zones. A zone may be any partitioned subset of the physicalmemory or memory system into which a specified range of logical blockaddresses is mapped. For example, a memory system capable of storing 64Megabytes of data may be partitioned into four zones that store 16Megabytes of data per zone. The range of logical block addresses is thenalso divided into four groups, one group being assigned to the physicalblocks of each of the four zones. Logical block addresses areconstrained, in a typical implementation, such that the data of each arenever written outside of a single physical zone into which the logicalblock addresses are mapped. In a memory cell array divided into planes(sub-arrays), which each have their own addressing, programming andreading circuits, each zone preferably includes blocks from multipleplanes, typically the same number of blocks from each of the planes.Zones are primarily used to simplify address management such as logicalto physical translation, resulting in smaller translation tables, lessRAM memory needed to hold these tables, and faster access times toaddress the currently active region of memory, but because of theirrestrictive nature can result in less than optimum wear leveling.

Individual flash EEPROM cells store an amount of charge in a chargestorage element or unit that is representative of one or more bits ofdata. The charge level of a storage element controls the thresholdvoltage (commonly referenced as V_(T)) of its memory cell, which is usedas a basis of reading the storage state of the cell. A threshold voltagewindow is commonly divided into a number of ranges, one for each of thetwo or more storage states of the memory cell. These ranges areseparated by guardbands that include a nominal sensing level that allowsdetermining the storage states of the individual cells. These storagelevels do shift as a result of charge disturbing programming, reading orerasing operations performed in neighboring or other related memorycells, pages or blocks. Error correcting codes (ECCs) are thereforetypically calculated by the controller and stored along with the hostdata being programmed and used during reading to verify the data andperform some level of data correction if necessary. Also, shiftingcharge levels can be restored back to the centers of their state rangesfrom time-to-time, before disturbing operations cause them to shiftcompletely out of their defined ranges and thus cause erroneous data tobe read. This process, termed data refresh or scrub, is described inU.S. Pat. Nos. 5,532,962 and 5,909,449.

In some memory arrays, a page may consist of a portion of an erase blockthat can hold multiple sectors of data. Once the page has been written,no further writing may be possible without corrupting the data that isalready written. For memory arrays using such a system, a page may bedefined by a set of memory cells that are connected to the same wordline. Such memory arrays may be inefficiently programmed where data isreceived in amounts that are less than the size of a page. For example,where data is received one sector at a time, just one sector may beprogrammed to a page. No additional data may be programmed to the pagewithout risk of corrupting the sector of data that is already savedthere. Sometimes a series of single sectors may be received with somedelay between them. In this case, each sector is written to a separatepage of the memory array. Thus, the sectors are stored in a way that isinefficient in how it uses space in the memory array. Where multi-levellogic is used, memory cells are particularly sensitive to the effects oflater programming of nearby cells. In addition, programming ofmulti-level cells is generally done by programming a group of cells witha first page of data and later programming the cells with a second pageof data. The programming of the second page of data may cause corruptionof the first page of data in some cases. Hence, there is a need for amore efficient way to store data in a memory array that has amulti-sector page when the memory array receives data in amounts thatare less than a page. There is also a need for a way to preventcorruption of data of a first page during programming of a subsequentpage when programming a group of multi-level cells.

SUMMARY

In a memory array having a block as the unit of erase, one or moreblocks may be designated as scratch pad blocks and may be used toimprove performance of the memory system. A scratch pad block mayoperate as a buffer so that data is written to the scratch pad blockwith a low degree of parallelism and then copied to another locationwithin the memory array with a high degree of parallelism. Data may beaccumulated in the scratch pad block until it may be more efficientlywritten to another location. In memories having multi-sector pages,sectors may be accumulated until a full page may be written using themaximum parallelism of the system. In multi-level cell memories, a lowerpage may be stored in a scratch pad block until the upper page isavailable so that the upper and lower pages are stored together.

The degree of parallelism of a particular program operation isproportional to the number of bits of data that are programmed together.Thus, programming a large amount of data together is considered a writewith high parallelism, while programming a small amount of data togetheris considered low parallelism. Where parallelism of less than a page isused, space in the memory array may be wasted and this wasted spacemeans that garbage collection must be performed more often thusadversely affecting the efficiency of the memory system. Sometimes,small amounts of data must be stored in the memory system. By writingthese small writes in one location, a scratch pad block, and laterwriting them together with higher parallelism to another location, theefficiency of the memory system may be improved.

In a memory system having a minimum unit of program of a page thatconsists of multiple sectors of data, a method of storing data that arereceived in amounts that are less than one page is disclosed. A blockdesignated as a scratch pad block is used to store received sectorsuntil a complete page may be written to the flash memory array. A firstsector is stored in a first page of the scratch pad block. Subsequentlyreceived sectors may be stored in additional pages of the scratch padblock. Individually received sectors or groups of sectors are saved in anew page of the scratch pad block when they are received. Previouslystored sectors from other pages in the scratch pad block may be copiedto the latest page along with the new data. Thus, sectors of data areaccumulated in the scratch pad block as long as there is less than afull page of new data in a page of the scratch pad block. Sectors arewritten to the scratch pad block with a lower degree of parallelism thanthe maximum available parallelism for the block. Sectors may be updatedwhile stored in the scratch pad block. When a new sector of data isreceived that results in a full page of data being available forprogramming, the new sector and the sectors previously stored in thescratch pad block may be programmed together to the same page in anotherblock of the memory array. This page is fully populated with data and iswritten with the maximum available parallelism. The data stored in thescratch pad block may then be marked as obsolete and may be erased at aconvenient time. Thus, space in the flash memory is more efficientlyused and the frequency of garbage collection operations is reduced.

In memories having multi-level cells, a scratch pad block may store apage of data that is also written to an active block. The stored pagemay be kept in the scratch pad block until another page of data isreceived so that the two pages of data may be written together to theirdestination in an active block. They may be written as an upper andlower page together using a high degree of parallelism and with a lowerrisk of corrupting data than if they were written separately. Thescratch pad block may also be used to retain a copy of a previouslyprogrammed lower page during programming of the associated upper page sothat if there is a loss of power, the data in the lower page may berecovered from the scratch pad block.

A scratch pad block may allow temporary storage of data that is to bewritten to another location. Data may be stored in a scratch pad blockduring updating of sectors of data of a block. Where a page within ablock contains sectors of data from different files, the page is updatedwhen either block is updated. It may require more than one block tostore the updated data from the two files using conventional methodsbecause two copies of the multi-file page may be needed. Using a scratchpad block allows part of the page from one file to be stored until theremainder of the page (from the other file) is available. Then, thecomplete updated page is programmed to its destination using maximumparallelism.

A scratch pad block may contain sectors of unrelated data. Both hostdata sectors and control data sectors may be stored in a scratch padblock. Both host data sectors and control data sectors may be stored inthe same page within a scratch pad block. Sectors from two differentfiles or from logically remote portions of the same file may be storedin the same page of a scratch pad block. This may allow programming ofthe scratch pad block with maximum parallelism so that high speed ismaintained as data is received. Where data is received at a low speed,the additional space in a page may be occupied by sectors containingcontrol data. This may allow control data structures to be updated lessfrequently thus reducing the frequency of garbage collection.

Generally, the sectors stored in the same page of a scratch pad blockneed not belong to different files. As independent data objects, theyjust need to be, for example, two logical sectors of the same page, butwritten by different write commands.

A scratch pad may be identified by a marking sector so that a controllermay easily identify it. An index of data stored in a scratch pad blockmay be maintained in an index sector which itself is stored in thescratch pad block. As new sectors are stored in the scratch pad blockthe index sector is updated by replacing the old index sector with a newindex sector. Similarly, as sectors in the scratch pad block are copiedto other locations, the index sector may be updated to indicate thatthese sectors in the scratch pad block are obsolete.

Improved Indexing for Scratch Pad and Update Blocks—SPBI/CBI IndicesMaintained in Scratch Pad Blocks

According to another aspect of the invention, when a scratch pad blockis employed in addition to an update block, an associated scratch padblock index (“SPBI”) is used to keep track of the update sectorsrecorded in the scratch pad block. This is in addition to an index(e.g., “CBI”) used to keep track of the logical sectors recorded in theupdate block. Whenever user data is stored in a partial page of thescratch pad block, it means that at least the last slot of the page isunfilled. In one embodiment, the SPBI can be stored in the last slot ofthe partial page in the scratch pad block. In a preferred embodiment,the SPBI and the CBI can be packaged within a SPBI/CBI sector and storedat the last slot of a partial page in the scratch pad block which isunused anyway. Every time a new partial page is written, an updatedSPBI/CBI sector is written at the end slot, rendering all previousversions obsolete.

At the same time, the indexing scheme takes advantage of the unusedstorage in the scratch pad block to store an index in nonvolatilememory.

According to yet another aspect of the invention, data stored in amemory block has its index stored in a portion of a partial pageunoccupied by data. Thus, in a memory organized into memory units wherea page of memory units is programmable together and a block of memorypages is erasable together, partially filled pages will exist when dataunits stored in the memory units are aligned in the page according to apredetermined order, and especially if the page is once-programmableafter each erase. The index for the block is then stored in a partialpage not filled with update data. The partial page may be in the currentblock or in another block.

Multi-Stream Update Tracking—Synchronization Between Two or More Streams

According to another aspect of the invention, a method is provided towrite update data to a non-volatile memory with synchronizationinformation that allows identifying the most recently written version ofdata that may exist on multiple memory blocks. Update data from a hostmay be directed to multiple blocks via multiple streams. The maintenanceof the synchronization information is accomplished by storinginformation about how full the stream/blocks are at the time of everyupdate of at least one of the streams.

In a preferred embodiment, a write pointer that points to the firstempty location in a block will indicate how full the block is. Forexample, between two streams, the value of a write pointer for a secondblock indicates how full the second block at the time the write pointeris written to a first block. Furthermore, the position where the writepointer is saved in the first block also indicates how full the firstblock is at the time.

The invention is particular applicable to a nonvolatile memory that isorganized into erasable blocks of memory units, each memory unit forstoring a logical unit of data, and each block also organized into oneor more pages. Furthermore, each page is once programmable after anerase with multiple logical units, each logical unit in a predeterminedorder with a given page offset. The method essentially provides twoblocks (e.g., an update block and a scratch pad block) for storing orbuffering update data of a group of logical units, and maintainssynchronization information for helping to identify whether the mostrecently written version of a logical unit is located in the first orsecond block.

Accordingly to a preferred embodiment, the synchronization informationin the form of a write pointer is saved together with host data everytime it is being buffered in a scratch pad block. The write pointer isan update-block write pointer that gives the address of the location forthe next write in the update block at the time the write pointer issaved in the scratch pad block. In particular, it is saved in a portionof the scratch pad block not utilized for storing host data anyway.Preferably, the update-block write pointer is included in the indexSPBI/CBI stored in a partial page of the scratch pad block. Theupdate-block write pointer would allow determination of whether a givenlogical sector buffered in the scratch pad block has been renderedobsolete by subsequent writes to the update block.

According to another embodiment of the invention, synchronizationinformation is maintained that would allow determination of whether agiven logical sector buffered in the scratch pad block has been renderedobsolete by subsequent writes to the update block. This is accomplishedby including a scratch-pad write pointer that gives the address of thelocation for the next write in the scratch pad block at the time thesynchronization information is stored in a page of the update block.

In yet another embodiment, the synchronization information can beencoded as time stamps for data sectors written to multiple streams sothat the latest version can be correctly found.

In the preferred embodiment, the time stamp information is stored in anoverhead portion of at least one of the sectors in the page beingwritten.

Multi-Stream Updating with Pipelined Operation

According to another aspect of the invention, a method of updating anonvolatile memory includes using a first block (update block) forrecording update data and a second block (scratch pad block) fortemporary saving some of the update data before recording to the updateblock. The nonvolatile memory is organized into erasable blocks ofmemory units, each memory units for storing a logical unit of data, andeach block also organized into one or more pages, with each page capableof storing multiple logical units having definite page offsets, andbeing once programmable together after an erase. The method furtherincludes receiving the logical units from a host and aligning thereceived logical units page by page, so that when a predeterminedcondition is satisfied where a received logical unit has a page endoffset, storing the received logical unit and any preceding logicalunits to a page in the update block with appropriate page alignment,otherwise, temporarily storing any remaining received logical units to apartial page in the scratch pad block. The logical units in the scratchpad block are eventually transferred to the update block when thepredetermined condition is satisfied.

In a preferred embodiment, the update data is received and parsed pageby page for transferring to the first block (e.g., update block). Anyremaining partial page of received data is transferred to the secondblock (e.g., scratch pad block) and will remain there until a full pageof data becomes available for recording to the first block. When thereceived data is transferred to the second block, it is recorded page bypage, albeit the recorded page is only partially filled with thereceived data. The spare, normally unused, space in the partial page isused to store an index for locating the data in the second and firstblocks.

According to another preferred embodiment, a predictive pipelinedoperation is implemented in which, rather than waiting until thepredetermined condition for recording to the update block is confirmed,the update block is set up to be written to as soon as the host writecommand indicates the predetermined condition is potentially satisfiedby the data units intended to be written. In this way, the set up couldhave a jump start while waiting for the data units to come from thehost. When the actual data units received eventually do satisfy thepredetermined condition, programming of the page in the update block cantake place immediately without have to wait for setup, thereby improvingwrite performance. In the event that the host write was interrupted andthe actual data units received no longer satisfy the predeterminedcondition, the setup for recording to the update block will beabandoned, and instead the data units will be recorded to the scratchpad block.

In another preferred embodiment, as data is being received and whenthere is initially uncertainty in recording the received data whether tothe first or second storage, the received data is loaded to the datalatches of the programming circuits for both first and second storage.In this way, the data will always be immediately available forprogramming either the first or second storage. In a special case, thefirst and second storages share the same set of data latches. Forexample, when first and second storages are in the same memory plane,they could be served by the same set of programming circuits with thesame set of sense amplifiers and data latches. In that case, data willbe loaded to a set of default data latches irrespective of whether firstor second storage is to be programmed.

Additional features and advantages of the present invention will beunderstood from the following description of its preferred embodiments,which description should be taken in conjunction with the accompanyingdrawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIGS. 1A and 1B are block diagrams of a non-volatile memory and a hostsystem, respectively, that operate together.

FIG. 2 illustrates a first example organization of the memory array ofFIG. 1A.

FIG. 3 shows an example host data sector with overhead data as stored inthe memory array of Figure IA.

FIG. 4 illustrates a second example organization of the memory array ofFIG. 1A.

FIG. 5 illustrates a third example organization of the memory array ofFIG. 1A.

FIG. 6 shows an extension of the third example organization of thememory array of FIG. 1A.

FIG. 7 is a circuit diagram of a group of memory cells of the array ofFIG. 1A in one particular configuration.

FIG. 8 shows storage of sectors of data in a block of a memory arraysuch as the memory array of FIG. 1A.

FIG. 9 shows an alternative storage of sectors of data in a block of amemory array such as the memory array of FIG. 1A.

FIG. 10A shows sectors of data of FIG. 8 or 9 after copying to anotherblock during a garbage collection operation.

FIG. 10B shows sectors of data of FIG. 10A after copying to anotherblock during a second garbage collection operation.

FIG. 10C shows the block of FIG. 10B after more sectors of data arereceived.

FIG. 11A shows an alternative storage arrangement using two eraseblocks, an active block and a scratch pad block, to store the sectors ofdata of FIGS. 10A and 10B.

FIG. 11B shows an alternative storage arrangement using two metablocks,an active block and a scratch pad block, to store sectors of data ofFIGS. 10A and 10B.

FIG. 12A shows two blocks, an active block and a scratch pad block, usedto store sectors of data so that the sectors of data may be updatedwhile stored without triggering a garbage collection operation.

FIG. 12B shows an alternative storage system to that of FIG. 12Aallowing all sectors of a page to be updated while stored withouttriggering a garbage collection.

FIG. 12C shows another example of updating data using scratch pad block1250.

FIG. 13 shows four threshold voltage ranges used to store two bits ofdata in a multi-level cell.

FIG. 14 shows two blocks of multi-level cells, an active block and ascratch pad block, where the scratch pad block keeps a copy of a lowerpage of an active block.

FIG. 15 shows sectors of data from two files stored in a block and thesubsequent storage of the sectors of data when the two files are updatedrequiring more than one block of space in the memory array.

FIG. 16 shows an alternative system of updating the sectors of data ofFIG. 15 where a scratch pad block stores some sectors before they arecopied to an active block.

FIG. 17 shows a scratch pad block storing sectors of unrelated data inthe same page and the subsequent copying of this data to differentlocations.

FIG. 18 shows a scratch pad block storing sectors of unrelated dataundergoing multiple updates.

FIG. 19 shows a scratch pad block identified by a marking sector.

FIG. 20 shows the scratch pad block of FIG. 19 storing a group ofsectors and an index sector.

FIG. 21 shows the scratch pad block of FIG. 20 storing a second group ofsectors and a second index sector that supersedes the first indexsector.

FIG. 22 shows the scratch pad block of FIG. 21 storing a third group ofsectors and a third index sector that supersedes the second indexsector.

FIG. 23 shows the scratch pad block of FIG. 22 with a fourth indexsector that supersedes the third index sector when a group is copied toanother block.

FIG. 24 illustrates an example of sectors in a logical group beingupdated and stored in an update block having single-sector pages in aconventional manner.

FIG. 25 illustrates the same sequence of writes shown in FIG. 24 asapplied to a memory where the pages are multi-sector and possiblyonce-writable.

FIG. 26 is a flowchart illustrating a method of updating data byemploying a first memory block in conjunction with a second memoryblock, with an index of the stored data saved in the second block,according to a general embodiment of the invention.

FIG. 27A illustrates a specific example of updating data and maintainingindices by employing an update block in conjunction with a scratch padblock, according to a preferred embodiment of the invention

FIG. 27B illustrates another example of the sequential ordering ofupdating data being maintained by employing an update block inconjunction with a scratch pad block, according to a preferredembodiment of the invention.

FIG. 28 illustrates a preferred scheme for saving an index of a memoryblock for storing update data in a partial page of the block.

FIG. 29 illustrates schematically, a scratch pad block used in amulti-stream update in which several logical groups are concurrentlyundergoing updates.

FIG. 30 illustrates a conventional case of writing a sequence of inputdata to a block.

FIG. 31A illustrates a scheme of keeping track of the recording order orpriority even when the different writes are interleaved over two blocks,according to a preferred embodiment of the invention.

FIG. 31B illustrates another embodiment of keeping track of therecording order when the writes are recorded over two blocks.

FIG. 32A is a flowchart illustrating a method of synchronizing therecording sequence between two data streams, according to a generalembodiment of the invention.

FIG. 32B is a flowchart illustrating a method of synchronizing therecording sequence between two data streams, according to an embodimentusing a write pointer.

FIG. 33A shows the state of the scratch pad block and the update blockafter two host writes #1 and #2 according to a first sequence.

FIG. 33B shows the state of the scratch pad block and the update blockafter two host writes #1 and #2 according to a second sequence which isthe reverse of the first sequence shown in FIG. 33A.

FIG. 34A illustrates a preferred data structure of the scratch pad blockindex (SPBI).

FIG. 34B illustrates example values in the Scratch Pad Block Index forthe host write #1 shown in FIG. 33A.

FIG. 35A and FIG. 35B shows the intermediate state of the scratch padblock and the update block relative to the scratch-pad write pointerrespectively after the successive host writes of FIG. 33A and FIG. 33B.

FIG. 36 illustrates the scratch-pad write pointer being stored in anoverhead portion of a sector being recorded to the update block.

FIG. 37 illustrates the use of time stamps to keep track of therecording sequence between two update streams.

FIG. 38 is a flowchart illustrating a method of recording and indexingupdate data to two memory blocks concurrently, each memory block havingmultiple-sector pages, according to a general embodiment of theinvention.

FIG. 39 is a flowchart illustrating a more specific implementation ofthe method of FIG. 37 employing a scratch pad block and an update block.

FIG. 40A illustrates schematically a memory device having a bank ofread/write circuits, which provides the context in which the presentinvention is implemented.

FIG. 40B illustrates a preferred arrangement of the memory device shownin FIG. 40A.

FIG. 41 illustrates in more detail the sense module shown in FIG. 40A.

FIG. 42 is a flow diagram illustrating a multi-stream update employing apredictive pipelining scheme, according to a preferred embodiment.

FIG. 43 is a flow diagram illustrating a multi-stream update in whichthe program data is loaded before the correct destination address issent, according to another embodiment.

DESCRIPTION OF EXEMPLARY EMBODIMENTS

Memory Architectures and Their Operation

Referring initially to FIG. 1A, a flash memory includes a memory cellarray and a controller. In the example shown, two integrated circuitdevices (chips) 11 and 13 include an array 15 of memory cells andvarious logic circuits 17. The logic circuits 17 interface with acontroller 19 on a separate chip through data, command and statuscircuits, and also provide addressing, data transfer and sensing, andother support to the array 13. A number of memory array chips can befrom one to many, depending upon the storage capacity provided. Thecontroller and part or the entire array can alternatively be combinedonto a single integrated circuit chip but this is currently not aneconomical alternative.

A typical controller 19 includes a microprocessor 21, a read-only-memory(ROM) 23 primarily to store firmware and a buffer memory (RAM) 25primarily for the temporary storage of user data either being written toor read from the memory chips 11 and 13. Circuits 27 interface with thememory array chip(s) and circuits 29 interface with a host thoughconnections 31. The integrity of data is in this example determined bycalculating an ECC with circuits 33 dedicated to calculating the code.As user data is being transferred from the host to the flash memoryarray for storage, the circuit calculates an ECC from the data and thecode is stored in the memory. When that user data are later read fromthe memory, they are again passed through the circuit 33 whichcalculates the ECC by the same algorithm and compares that code with theone calculated and stored with the data. If they compare, the integrityof the data is confirmed. If they differ, depending upon the specificECC algorithm utilized, those bits in error, up to a number supported bythe algorithm, can be identified and corrected.

The connections 31 of the memory of FIG. 1A mate with connections 31′ ofa host system, an example of which is given in FIG. 1B. Data transfersbetween the host and the memory of FIG. 1A are through interfacecircuits 35. A typical host also includes a microprocessor 37, a ROM 39for storing firmware code and RAM 41. Other circuits and subsystems 43often include a high capacity magnetic data storage disk drive,interface circuits for a keyboard, a monitor and the like, dependingupon the particular host system. Some examples of such hosts includedesktop computers, laptop computers, handheld computers, palmtopcomputers, personal digital assistants (PDAs), MP3 and other audioplayers, digital cameras, video cameras, electronic game machines,wireless and wired telephony devices, answering machines, voicerecorders, network routers and others.

The memory of FIG. 1A may be implemented as a small enclosed cardcontaining the controller and all its memory array circuit devices in aform that is removably connectable with the host of FIG. 1B. That is,mating connections 31 and 31′ allow a card to be disconnected and movedto another host, or replaced by connecting another card to the host.Alternatively, the memory array devices may be enclosed in a separatecard that is electrically and mechanically connectable with a cardcontaining the controller and connections 31. As a further alternative,the memory of FIG. 1A may be embedded within the host of FIG. 1B,wherein the connections 31 and 31′ are permanently made. In this case,the memory is usually contained within an enclosure of the host alongwith other components.

FIG. 2 illustrates a portion of a memory array wherein memory cells aregrouped into erase blocks, the cells in each erase block being erasabletogether as part of a single erase operation, usually simultaneously. Anerase block is the minimum unit of erase in this type of memory.

The size of the individual memory cell erase blocks of FIG. 2 can varybut one commercially practiced form includes a single sector of data inan individual erase block. The contents of such a data sector areillustrated in FIG. 3. User data 51 are typically 512 bytes. In additionto the user data 51 are overhead data that includes an ECC 53 calculatedfrom the user data, parameters 55 relating to the sector data and/or theerase block in which the sector is programmed and an ECC 57 calculatedfrom the parameters 55 and any other overhead data that might beincluded.

One or more flags may also be included in the parameters 55 thatindicate status or states. Indications of voltage levels to be used forprogramming and/or erasing the erase block can also be stored within theparameters 55, these voltages being updated as the number of cyclesexperienced by the erase block and other factors change. Other examplesof the parameters 55 include an identification of any defective cellswithin the erase block, the logical address of the erase block that ismapped into this physical erase block and the address of any substituteerase block in case the primary erase block is defective. The particularcombination of parameters 55 that are used in any memory system willvary in accordance with the design. Also, some or all of the overheaddata can be stored in erase blocks dedicated to such a function, ratherthan in the erase block containing the user data or to which theoverhead data pertains.

Different from the single data sector erase block of FIG. 2 is amulti-sector erase block of FIG. 4. An example erase block 59, still theminimum unit of erase, contains four pages 0-3, each of which is theminimum unit of programming. One or more host sectors of data are storedin each page, usually along with overhead data including at least theECC calculated from the sector's data and may be in the form of the datasector of FIG. 3.

Re-writing the data of an entire block usually involves programming thenew data into a block of an erase block pool, the original block thenbeing erased and placed in the erase pool. When data of less than allthe pages of a block are updated, the updated data are typically storedin a page of a block from the erased block pool and data in theremaining unchanged pages are copied from the original block into thenew block. The original block is then erased. Variations of this largeblock management technique include writing the updated data into a pageof another block without moving data from the original block or erasingit. This results in multiple pages having the same logical address. Themost recent page of data is identified by some convenient technique suchas the time of programming that is recorded as a field in sector or pageoverhead data.

A further multi-sector block arrangement is illustrated in FIG. 5. Here,the total memory cell array is physically divided into two or moreplanes, four planes 0-3 being illustrated. Each plane is a sub-array ofmemory cells that has its own data registers, sense amplifiers,addressing decoders and the like in order to be able to operate largelyindependently of the other planes. All the planes may be provided on asingle integrated circuit device or on multiple devices, an examplebeing to form each plane from one or more distinct integrated circuitdevices. Each block in the example system of FIG. 5 contains 16 pagesP0-P15, each page having a capacity of one, two or more host datasectors and some overhead data.

Yet another memory cell arrangement is illustrated in FIG. 6. Each planecontains a large number of erase blocks of cells. In order to increasethe degree of parallelism of operation, erase blocks within differentplanes are logically linked to form metablocks. One such metablock isillustrated in FIG. 6 as being formed of erase block 3 of plane 0, eraseblock 1 of plane 1, erase block 1 of plane 2 and erase block 2 of plane3. Each metablock is logically addressable and the memory controllerassigns and keeps track of the erase blocks that form the individualmetablocks. The host system preferably interfaces with the memory systemin units of data equal to the capacity of the individual metablocks.Such a logical data block 61 of FIG. 6, for example, is identified by alogical block addresses (LBA) that is mapped by the controller into thephysical block numbers (PBNs) of the blocks that make up the metablock.All erase blocks of the metablock are erased together, and pages fromeach erase block are preferably programmed and read simultaneously. Ametablock may be considered the unit of erase in a system in which eraseblocks are linked in this way. In some memory arrays having metablockarchitecture, pages may only be programmed in parallel with other pagesof the metablock. In these memory arrays, a metapage is a minimum unitof programming of a metablock that consists of a page from each plane ofthe metablock.

There are many different memory array architectures, configurations andspecific cell structures that may be employed to implement the memoriesdescribed above with respect to FIGS. 2-6. One erase block of a memoryarray of the NAND type is shown in FIG. 7. A large number of columnoriented strings of series connected memory cells are connected betweena common source 65 of a voltage V_(SS) and one of bit lines BL0-BLN thatare in turn connected with circuits 67 containing address decoders,drivers, read sense amplifiers and the like. Specifically, one suchstring contains charge storage transistors 70, 71 . . . 72 and 74connected in series between select transistors 77 and 79 at oppositeends of the strings. In this example, each string contains 16 storagetransistors but other numbers are possible. Word lines WL0-WL15 extendacross one storage transistor of each string and are connected tocircuits 81 that contain address decoders and voltage source drivers ofthe word lines. Voltages on lines 83 and 84 control connection of allthe strings in the erase block together to either the voltage source 65and/or the bit lines BL0-BLN through their select transistors. Data andaddresses come from the memory controller.

Each row of charge storage transistors (memory cells) of the erase blockmay form a page that is programmed and read together. An appropriatevoltage is applied to the word line (WL) of such a page for programmingor reading its data while voltages applied to the remaining word linesare selected to render their respective storage transistors conductive.In the course of programming or reading one row (page) of storagetransistors, previously stored charge levels on unselected rows can bedisturbed because of voltages applied across all the strings and totheir word lines. This may prevent programming of cells of a particularrow after other cells in the row have been programmed. Multiple stateflash memories are particularly sensitive to disturbance. The increasednumber of logic states results in narrow threshold voltage ranges forindividual states so that small changes in charge level may produce achange in logic state. As data storage density is increased by usingincreased numbers of logic states in a cell, sensitivity to disturbanceincreases. Thus, it may not be possible to program data to cells in arow after other cells in that row are programmed without corrupting thedata in the programmed cells. Thus, disturbance from subsequentprogramming of adjacent cells may define the page size. If cells in arow may not be programmed subsequent to programming other cells in thesame row, then the row defines the minimum unit of programming. Thus, arow of cells may contain one page of data. In such a memory array, if agroup of cells in a row is programmed, the row is considered programmedeven where some cells in the row contain no data. It is not efficient tohave empty cells that cannot be subsequently programmed in the memoryarray.

Empty cells in a programmed page may result from small numbers ofsectors being received by the memory system at a time. For example, asingle sector may be sent by a host to a memory system. The sector isstored in a page of the flash memory array. The sector preventssubsequent writing to that page. In a memory system in which a pageholds multiple sectors, this may be inefficient. For example, where apage comprises four sectors of data, a portion of the memory array thatcould hold three sectors of data is left empty when a single sector iswritten to the page. As page sizes increase, the wasted space from suchpartially filled pages increases. Metapages may contain large numbers ofsectors so storage may be particularly inefficient in memory arrays thatuse metablocks. The problem is similar where two or more sectors arereceived but the number of sectors received is less than the number ofsectors in a page. Such partial pages may be stored in the scratch padblock until a full page of data is received.

Subsequent to writing partially filled pages of data, consolidation ofstored data may be performed to combine data from partially filled pagesinto filled pages. This may be done as part of periodically performedgarbage collection. Such consolidation of data copies data from thepartially filled pages to full pages that are in a different eraseblock. The erase blocks that hold the partially filled pages are thenmarked as obsolete so that they may be erased and reused. Such anoperation may take system resources that could be used for otherfunctions.

Example of Single Sector Writes to Memory

FIG. 8 shows an erase block, designated active block 800 of a memoryarray in a memory system in which a page is comprised of four sectors ofdata. Pages 0-5 are shown each extending in the horizontal direction.Each page may contain four sectors of data designated as sector 0,sector 1, sector 2 and sector 3. A host sends single sectors of data tothe memory system, which are stored in active block 800. Sector X isreceived and stored as sector 0 of page 0. This prevents subsequentprogramming of page 0. Thus, sectors 1, 2 and 3 of page 0 are notprogrammed and remain empty (erased). After page 0 is programmed, sectorX+1 is received. Sector X+1 is stored as sector 0 of page 1. Sectors 1,2 and 3 of page 1 remain empty. After sector X+1 is programmed, sectorX+2 is received. Sector X+2 is stored as sector 0 of page 2. Sectors 1,2 and 3 of page 2 remain empty. After sector X+2 is programmed, sectorX+3 is received. Sector X+3 is stored as sector 0 of page 3. Sectors 1,2 and 3 of page 3 remain empty.

FIG. 9 shows an alternative way of storing sectors in an erase block,designated active block 900. Here, instead of storing just one sectorper page, previously stored sectors are copied to a new page in the sameerase block where they are stored with a more recently received sector.Sector X is stored as sector 0 of page 0 as before. Then, sector X+1 isreceived and stored as sector 1 of page 1 with sector X copied from page0 to sector 0 of page 1. Thus, both sector X and sector X+1 are storedin page 1. Subsequently, sector X+2 is received and stored as sector 2of page 2. Sector X is stored as sector 0 of page 2 and sector X+1 isstored as sector 1 of page 2. Thus, sectors X, X+1 and X+2 are storedtogether in page 2. Subsequently, sector X+3 is received and stored assector 3 of page 3. Sector X is stored as sector 0, sector X+1 is storedas sector 1 and sector X+2 is stored as sector 2 of page 3. Thus, foursectors of data are stored in page 3 so that page 3 is fully populatedwith data.

Subsequent to the storage of sectors shown in FIG. 8 or in FIG. 9, datamay be consolidated. Sectors X, X+1, X+2 and X+3 of either FIG. 8 orFIG. 9 may be copied to a single page of a new erase block. This may bedone as part of garbage collection at a time when it is convenient. FIG.10A shows sectors X, X+1, X+2 and X+3 stored in page 0 of designatedactive block 1000. Page 0 of erase block 1000 is filled with data. Whenpage 0 of active block 1100 is programmed with sectors X, X+1, X+2 andX+3, sectors X, X+1, X+2 and X+3 may be erased from the erase block fromwhich they were copied. Active blocks 800, 900 may be erased and madeavailable for storage of new data when their contents are consolidatedduring garbage collection.

Subsequent to programming of page 0, sector X+4 is received and isstored as sector 0 of page 1 of active block 1000. Then, sectors X+5,X+6 and X+7 are individually received and stored in pages 2, 3 and 4respectively. Consolidation of sectors may be needed again toconsolidate sectors X+4, X+5, X+6 and X+7 to a single page. Suchconsolidation of sectors takes time during which host data may not bewritten. After the second consolidation of data to another erase block,erase block 1000 from which they are copied is marked as obsolete andmay subsequently be erased.

FIG. 10B shows an active block 1010 after the second garbage collectionoperation relocates data from the previous active block 1000. SectorsX+4 to X+7 are consolidated into a single page (page 1 ) of active block1010. Subsequently, more sectors may be received and may be stored inactive block 1010. If such sectors are received in the form of singlesectors, a single sector may be stored in a page as before.

FIG. 10C shows active block 1010 with additional sectors X+8 to X+11stored in pages 2-5. Another garbage collection operation may be neededto consolidate sectors X+8 to X+11 at this point. Thus, in order toefficiently store sectors that are received from a host as singlesectors, this method uses multiple garbage collection operations thatrequire transferring data from one erase block to another erase blockand erasing the first erase block. In larger erase blocks, the number ofgarbage collection operations is larger. In memory systems that usemetablocks, a group of erase blocks may be linked so that they areerased together and programmed together. Data may be programmed inmetapages containing many sectors. Therefore, storing single sectorsbecomes very inefficient because of the amount of garbage collectionnecessary.

FIG. 11A shows an alternative method of storing data. FIG. 11A shows twoerase blocks of a memory array. Active block 1110 is an erase block inwhich data may be programmed for long-term storage. Scratch pad block1120 is an erase block in which data may be programmed for short-termstorage. When small numbers of sectors are received, they are firststored in scratch pad block 1120. Sectors continue to be stored inscratch pad block 1120 until enough sectors are received to fill a pageof data. These sectors are then copied to a page of active block 1110.

Sector X is received and programmed as sector 0 of page 0 in scratch padblock 1120 as before. Subsequently, sector X+1 is received and stored assector 1 of page 1 of scratch pad block 1120 with sector X copied tosector 0 of page 1. Subsequently, sector X+2 is received and stored assector 2 of page 2 of scratch pad block 1120 with sectors X and X+1stored as sector 0 and sector 1 of page 2 respectively. Subsequent tostoring sector X+2 in scratch pad block 1120, sector X+3 is received. Atthis point, sectors X, X+1, X+2 and X+3 are written to page 0 of activeblock 1110. These four sectors form a full page of data. Thus, sectorsX, X+1, X+2 and X+3 are efficiently stored in page 0 of active block1110. Subsequently, sectors X+4, X+5, X+6 and X+7 are individuallyreceived. Sectors X+4, X+5 and X+6 are stored in pages 3, 4 and 5 ofscratch pad block 1120 and are copied to sectors 0, 1 and 2 of page 1 ofactive block 1110 when sector X+7 is received. Sector X+7 is programmeddirectly to sector 3 of page 1 of active block 1110. At this point,scratch pad block 1120 has no available pages for storing data and maybe designated as being ready for erase (obsolete). A new erase block maybe designated as a scratch pad block for the next sector, or group ofsectors, to be received. While this example shows single sectors beingreceived, this method may also be used for groups of sectors where thegroup of sectors has fewer sectors than the number of sectors in a page.Also, while the above examples show writing data from a scratch padblock to an active block with maximum parallelism, such writing may bedone with less than maximum parallelism and still provide an efficiencybenefit. Thus, sectors are written to the scratch pad block with onedegree of parallelism and subsequently written to another block with ahigher degree of parallelism so that the data is more densely packed andrequires less frequent garbage collection.

A scratch pad block may also be used in memory arrays that usemetablocks. For example FIG. 11B shows two metablocks, active block 1130and scratch pad block 1140. Both active block 1130 and scratch pad block1140 have four planes, indicated as planes 0-3. Each plane is one sectorwide, so four sectors are stored in a metapage of block 1130 or 1140.Both blocks have 6 metapages, indicated as metapage 0 -5. The techniquefor efficiently storing data is the same as that described above withrespect to erase blocks. Sectors are accumulated in scratch pad block1140 until a full metapage of data is available at which time a fullmetapage is programmed to active block 1130. For example, when sectorX+3 is received, a full metapage (sectors X, X+1, X+2 and X+3) isprogrammed to metapage 0 of active block 1 130. A metapage may have alarge number of sectors because metablocks may have many planes andplanes may be several pages wide. The technique described above isparticularly valuable for such large metapages because of the largeamount of space in the memory array that would otherwise be wasted. Asshown with respect to FIGS. 11A and 11B, aspects of this inventiondescribed with respect to examples using erase block architecture mayalso be applied to metablock architecture and vice versa. The term“block” may indicate either an erase block or a metablock depending onthe configuration of the memory array. In either case, a block is theunit of erase used in that configuration. Similarly, the term “page” mayrefer to either a page within a single erase block or a metapage of ametablock. In either case, a page is the unit of programming for theconfiguration.

Where a group of sectors is received that has more than the number ofsectors in a page, sectors may be programmed directly to the activeblock of the memory array without first being stored in the scratch padblock. Thus, full pages of data may be programmed directly to the activeblock with a high degree of parallelism, while partial pages of data areprogrammed to the scratch pad block with a lower degree of parallelismuntil they may be written as part of a full-page program to the activeblock. A controller may determine the destination for a particularsector or group of sectors. Where writing a group of sectors to theactive block would include both partial-page and full-page writes, thefull-pages may be written to the active block and the partial page maybe written to the scratch pad block.

FIG. 12A shows a further example where sectors from a host are updatedwhile they are stored in a scratch pad block. A first sector X₀ isreceived and stored in page 0 of scratch pad block 1250. A page in thisexample stores four sectors of data. A replacement for X₀, shown as X₁,is then received. The sectors in this example are numbered according totheir logical address, with a subscript to indicate whether the sectoris an update and if so, which version. Thus, sector X₁ is a sector withlogical address X and is the first updated version of this sector. Thisis a sector of data that has the same logical address as X₀ but maycontain different data reflecting some updated information. Sector X₁ iswritten to page 1 of scratch pad block 1250. The controller keeps trackof which sectors are current and which are obsolete. In scratch padblock 1250, the most recently written copy of a sector with a particularlogical address is the current version. Any other version is obsolete.Thus X₀ becomes obsolete when XI is programmed. Subsequent to receivingsector X₁, sector (X+1)₀ is received. This is a sector that is logicallysequential to sector X₁. Both sectors X₁ and (X+1)₀ are written to page2 . Subsequently, sector (X+1)₀ is replaced by (X+1)₁. This is anupdated version of sector (X+1)₀ that replaces sector (X+1)o. Sector(X+1)₁ is written to page 3 along with sector X₁. Subsequently, sector(X+2)₀ is received and written to page 4. Sector (X+2)₀ is subsequentlyreplaced by sector (X+2)₁ and written to page 5 along with sectors X₁and (X+1)₁. Subsequently, sector (X+3)₀ is received. Thus, a page ofdata (sectors X₁, (X+1)₁, (X+2)₁ and (X+3)₀) are available. Sectors X₁,(X+1)₁, (X+2)₁ and (X+3)₀ are written to a block designated as activeblock 1252. Sectors X₁, (X+1)₁, (X+2)₁ and (X+3)₀ are written to activeblock 1252 with parallelism of a full page write. This is the maximumpossible parallelism in this case. Thus, even though sectors X₁, (X+1)₁,(X+2)₁ and (X+3)₀ were written to the scratch pad block 1250 with a lowdegree of parallelism, they are subsequently written to active block1252 with a high degree of parallelism. This means that sectors X₁,(X+1)₁, (X+2)₁ and (X+3)₀ are more efficiently stored in the activeblock. More efficient storage may result in garbage collection beingnecessary less frequently, thus improving performance.

An alternative example is provided in FIG. 12B. This example is similarto that shown in FIG. 12A but here sector (X+3)₀ is stored in scratchpad block 1250 prior to being copied to active block 1252. This allowssector (X+3)₀ to be updated before it is written to active block 1252.Sector (X+3)₀ is shown being updated by being replaced by sector (X+3)₁.The complete page of data (sectors X₁, (X+1)₁, (X+2)₁ and (X+3)₁) may beheld in scratch pad block 1250, ready to be updated, until sometriggering event. In this case, sector (X+4)₀ is received, providing atriggering event. Sectors X₁, (X+1)₁, (X+2)₁ and (X+3)₁ are written toactive block 1252 at this point with maximum parallelism. Sector (X+4)₀is written to the next available page (page 8) in scratch pad block1250.

FIG. 12C shows another example of updating data using scratch pad block1250. Sectors of data X₀ to (X+15)₀ are stored in an original block1254. A host sends sector (X+6)₁, which is an updated sector with thesame logical address as sector (X+6)₀. Thus, sector (X+6)₁ is to replace(X+6)₀. In order to replace sector (X+6)₀, page 1 of original block 1254(containing sectors (X+4)₀ to (X+7)₀) is combined with sector (X+6)₁ andthe combination is written to page 0 of scratch pad block 1250.Combining these sectors may take place in a Random Access Memory such ascontroller ram 25 or may be done in memory registers that are connectedto the memory array. The updated page data may be kept in scratch padblock 1250 without writing it to an active block for some time. Where asubsequent updated sector (X+5)₁ is received from a host, the data maybe updated in scratch pad block 1250 by writing sector (X+5)₁ along withcopied sectors (X+4)₀, (X+6)₁, and (X+7)₀ to another page of scratch padblock 1250 (in this case, page 1 ). Multiple updates of a page of datain scratch pad block 1250 may be performed in this way. An update iscarried out by replacing the updated sector or sectors of data andcopying of unchanged sectors of data in a new page of scratch pad block1250. The copied sectors are copied within the same plane so thatcopying may be efficiently performed. Subsequently, the updated page ofdata may be copied to active block 1252 in the memory array.Non-sequential updates may be performed in this way without requiring achaotic update block. For example, updated sectors (X+6)₁ and (X+5)₁ arereceived non-sequentially in the above example, but active block 1252 issequential. Multiple pages of data may be held and updated at the sametime in a scratch pad block in this way. A page may be copied to anactive block when the page is no longer expected to be updated.

Example of Multi-Level Cell Programming

Certain kinds of memories may store more than one bit of data in eachcell of the memory array by dividing the threshold voltage range of afloating gate memory cell into more than two levels. FIG. 13 shows anexample of how such multi-level cell (MLC) memories may be programmed toprovide multiple threshold voltages that signify different logicalstates. Four different threshold voltages are shown, labeled A, B, C andD. Multiple cells are programmed to each voltage. FIG. 13 represents thedistribution of cell states with the number of cells represented on thevertical axis. Each threshold voltage A, B, C and D represents adifferent logical state. The four states represent two bits of data, onebit from a lower page of data and one bit from an upper page of data asindicated. In some examples, the lower page may be programmed first.After programming of the lower page, the cell is in state A or B.Subsequently, the upper page may be programmed so that the cell eitherstays in states A or B (for upper bit=1) or is modified to states C or D(for upper bit=0). Because these four states each have relatively narrowvoltage windows, MLC memories are particularly vulnerable to corruptionof data from relatively small changes in threshold voltages. In someexamples, it may be advantageous to program both lower and upper pagessimultaneously. This may help to reduce corruption of data in a cellcaused by programming of adjacent cells, such as may occur duringprogramming of upper page data.

FIG. 14 shows an example of how a scratch pad block 1460 may be used toreduce corruption of data in MLC memories. FIG. 14 shows both activeblock 1462 and scratch pad block 1460 as blocks of MLC memory. Pages ofboth blocks are numbered and shown as either “upper” or “lower”depending on which threshold voltage states are used to store the bitsof data of the page. In this example, the memory first receives sectorsX to X+3 and stores these sectors in lower page 0 of scratch pad block1460. Subsequently, the memory receives sectors X+4 to X+7. At thistime, both the lower page (sectors X to X+3) and the upper page (X+4 toX+7) are written simultaneously to active block 1462. This may avoidcorruption of lower page 0 of active block 1462 during programming ofupper page 0 of active block 1462. Typically, the time necessary toprogram the upper and lower pages together is the same as the timenecessary to program the upper page alone so that this system does notcarry a time penalty. Subsequent to programming of lower page 0 andupper page 0 of active block 1462 with sectors X to X+7, sectors X+8 toX+1 are received and are programmed to upper page 0 of scratch pad block1460. When sectors X+12 to X+15 are received, sectors X+8 to X+11 andsectors X+12 to X+15 are programmed in parallel to upper page 1 andlower page 1 of the active block. This system is continued forsubsequent sectors of data as shown. Thus, a page of data is written toscratch pad block 1460 and subsequently this page is written togetherwith an additional page to active block 1462 as upper and lower pages ofthe same group of memory cells. Programming to scratch pad block 1460occurs with the parallelism of a page, while programming to active block1462 takes place with double the parallelism of a page.

In an alternative embodiment, the upper and lower pages may be writtento an active block at different times but a copy of the lower page iskept in a scratch pad block in case the lower page in the active blockbecomes corrupted during programming of the upper page. In FIG. 14,sectors X to X+3 may be received and programmed to both the lower page 0of active block 1462 and to lower page 0 of scratch pad block 1460 atthe same time. Subsequently, sectors X+4 to X+7 are received and areprogrammed to upper page 0 of active block 1462. Sectors X+4 to X+7 arenot saved in scratch pad block 1460. If there is any problem during theprogramming of X+4 to X+7 to upper page 0 of active block 1462 (such asloss of power), the data in lower page 0 of active block 1462 could becorrupted. That is, the threshold voltage of the cells being programmedcould be modified so that they are no longer in a state representingdata of the lower page but have not been fully programmed to a staterepresenting data of the upper page. For example, a cell that is beingprogrammed from state A in FIG. 13 to state D could be in state B or Cat a time when programming stops. If data is corrupted in this mannerthe upper page of data that is being written may be recovered from thelocation from which it is being copied. However, in many cases, no othercopy of the lower page exists. Here, a copy of the lower page is kept inscratch pad block 1460 until the programming of the upper page iscompleted. Thus, an uncorrupted copy of the lower page exists and may beused to recover the data of the lower page.

Examples of Multiple Files

Data from more than one host data file may be stored in a single block.The break between files may occur within a page so that part of a pagecontains data from one file and part of a page contains data fromanother file. FIG. 15 shows an example where page 0 to page i-i oforiginal block 1570 contain data from a first file (file 1) and page i+1to page n−1 contain data from a second file (file 2). Page i containssectors (i*4) and (i*4)+1 from file 1 and sectors (i*4)+2 and (i*4)+3from file 2. The sectors of file 2 are shaded to illustrate that sectorsfrom two files are present.

FIG. 15 shows file 2 being updated to a new block 1572. The first page(page 0 ) of new block 1572 is written with the contents of page i oforiginal block 1570. Thus, page 0 of new block 1572 contains sectorsfrom both file 2 and file 1. Sectors (i*4) and (i*4)+1 from file 1 arenot updated at this point but may be copied in order to program a fullpage of data. The remainder of updated file 2 is programmed to pages 1to i−1 of new block 1572. Subsequently, file 1 is updated. Sector 0 tosector (i*4)−1 are stored in page i to page n−1. However, sectors (i*4)and (i*4)+1 are also part of file 1 and must be updated. Because newblock 1572 is full at this point, the updated sectors (i*4) and (i*4)+1are programmed to another block. Subsequently, sectors (i*4) and (i*4)+1and the sectors in new block 1572 may be consolidated to a single blockas part of a garbage collection operation. However, this takes time andsystem resources and is generally undesirable.

FIG. 16 shows an alternative technique for updating sectors of originalblock 1570 of FIG. 15 that contains sectors from two different files.This technique uses a scratch pad block 1674 to store updated sectorsuntil such time as they may be written as part of a full updated pagewith the maximum parallelism of the system. When file 2 is updated,updated sectors (i*4)+2 and (i*4)+3 are written to scratch pad block1674. Here, they are written to page 0 of scratch pad block 1674 and nodata is written to the rest of the page so that a low degree ofparallelism is used. The remaining sectors of file 2 (sectors (i*4)+4 toN−1) are copied to pages 0 to n−i of a new block 1676. These sectors areall written in full-page writes using the maximum parallelism.Subsequently, file 1 is updated. Sectors 0 to (i*4)−1 are programmedwith maximum parallelism into pages n−i+1 to n−2. Sectors (i*4) and(i*4)+1 of file 1 are then written in parallel with copying of sectors(i*4)+2 and (i*4)+3 to page n−1 of new block 1676. Thus, an updated copyof all the sectors that were previously held in original block 1570 arenow held in new block 1676 and no obsolete data is held in new block1676. There is generally no need to garbage collect a block such as newblock 1676. Each page of new block 1676 is programmed with maximumparallelism to achieve maximum density of data in the block. Sectors(i*4)+2 and (i*4)+3 in scratch pad block 1674 may be marked as obsoleteat this point. However, scratch pad block 1674 may be used for furtheroperations without requiring a garbage collection operation because thescratch pad block routinely contains both current and obsolete data.

Example of Storing Non-Sequential Sectors of Data

In some of the previous examples, sectors of data are written to thescratch pad block with a degree of parallelism that is less than that ofwriting a complete page. In such examples, the remaining space in thepage of the scratch pad block that is being written may remain emptybecause it is not possible to program it later without disturbingalready-stored data. In some cases, it is possible to use this otherwiseempty space and otherwise unused programming bandwidth to storeunrelated data in the same page. For example, where a memory systemreceives host data in single sectors or groups of sectors less than apage, these sectors of host data may be stored in the scratch pad blockin pages that also hold unrelated data such as unrelated host data orsectors of control data. Similarly, sectors from the beginning of a filethat are being stored in a scratch pad block for later storage as partof a full page may have additional sectors stored in the same scratchpad block page that are not logically related.

FIG. 17 shows an example where sectors X, X+1 and X+2 are stored in ascratch pad block 1780 as in previous examples. However, here theremaining space in the pages of the scratch pad block holding sectors X,X+1 and X+2 are used to store other data. Sectors Y, Y+1 and Y+2 arestored with sector X in page 0. Sectors Y, Y+1 and Y+2 may be logicallyunrelated to sectors X, X+1 and X+2. They may be from another host datafile or from another cluster of sectors within the same file. Sectors Y,Y+1 and Y+2 may be non-sequential with sectors X, X+1 and X+2 and may beseparated in logical address space. Similarly, sectors Z and Z+1 arestored in page 1 with sectors X and X+1. Sectors Z and Z+1 may belogically unrelated to both sectors X, X+1 and X+2 and sectors Y, Y+1and Y+2. Sectors X, X+1, X+2 and X+3 are 'subsequently written to a pageof another block when sector X+3 is received. Sectors Y, Y+1, Y+2 andY+3 are written to a page of another block when sector Y+3 is received.Thus, unrelated data may be stored in the same page of the scratch padblock to more efficiently use the available resources.

FIG. 18 shows another example of unrelated data stored in a scratch padblock 1890. Here, sectors X, X+1 and X+2 are stored and updated asbefore. However, here sector Y is also stored and updated in parallel.Updated sectors are denoted by a subscript indicating what version isstored. For example, sector X₀ is the original version of sector X,while XI is the first updated version of sector X. Sector Y may be asector of host data or a sector of control data that is frequentlyupdated. In some systems, control data such as FAT information isupdated as host data is stored. Where small amounts of host data arereceived it may be advantageous to update the control data in scratchpad block 1890. This may avoid updating a control structure where only asingle sector of control data is updated. At some later time, thecontrol data structures may be updated using control data from thescratch pad block.

Scratch Pad Block Management

A scratch pad block may be a designated block in the memory array. Afixed physical location may be chosen as the scratch pad block. However,this may result in uneven wear of the memory array. Alternatively, thedesignated block may be changed from time to time so that as the scratchpad block becomes filled with obsolete data, another erase block ischosen as the scratch pad block. In this case, data structures used bythe memory controller may identify the location of the scratch pad blockor the designated scratch pad block may be marked so that if thecontroller scans the erase blocks of the memory array it may determinewhich erase block is the scratch pad block. A scratch pad block may bemarked using a sector to identify it as a scratch pad block. Forexample, FIG. 19 shows marking sector 2110 as the first sector ofscratch pad block 2100. When the card is powered on, the erase blocks ofthe memory array (or a portion of the memory array) may be scanned todetermine the location of a scratch pad block or scratch pad blocks. Inthe example of FIG. 19, the first sector of each erase block is read tosee if it is a marking sector indicating a scratch pad block.

Data may be written to a scratch pad block as a data group. A data groupis a logically sequential group of sectors received from a host. When adata group is stored in the scratch pad block, an index sector is alsowritten that provides information about the data group stored. Thelocations of the sectors of the data group may be stored in an indexsector. A scratch pad block such as scratch pad block 2100 of FIG. 19may be used to store multiple data groups. FIG. 20 shows scratch pad2100 storing one data group. Data group 1 consists of two sectors 2220,2221. These sectors, marking sector 2110 and an index sector 2230 arestored in scratch pad 2100. Index sector 2230 stores information aboutgroup 1.

FIG. 21 shows scratch pad block 2100 of FIG. 20 after data group 2consisting of two sectors 2340, 2341 is programmed. Index sector 2350 isa new index sector that stores information about group 1 and group 2.Thus, index sector 2230 is obsolete because index sector 2350 contains acomplete record of the data groups of scratch pad block 2100 includinggroup 1.

FIG. 22 shows scratch pad block 2100 of FIG. 21 after programming ofdata group 3 consisting of sectors 2460, 2461 and 2462. Index sector2470 is a new index sector that stores information about data groups 1,2 and 3. Index sector 2470 contains a complete record of the data ofscratch pad block 2100 and thus makes index sector 2350 obsolete.

FIG. 23 shows scratch pad block 2100 of FIG. 22 after data group 1 anddata group 2 are read from scratch pad block 2100 and are written as asingle page in another block of the memory array. Index sector 2560stores information about data group 3. Data group 1 and data group 2 inscratch pad 2100 are obsolete and do not require indexing because theyare stored elsewhere. Thus, index sector 2560 contains a complete recordof all current data in scratch pad block 2100.

When a host requests a sector or sectors of data from the memory array,a controller may first check if the requested sectors are in the scratchpad block. If the sectors are not present in the scratch pad block, thesectors may be sought in the regular manner. Thus, the scratch pad doesnot require changes to the regular media management used to keep trackof the locations of sectors of data in the memory array.

Multi-Stream Updating and Indexing

FIG. 24 illustrates an example of sectors in a logical group beingupdated by storing the updates in an update block having single-sectorpages in a conventional manner. The data is packaged into logicalsectors and stored in metablocks (also simply referred to as “blocks”)where all logical sectors of a metablock are erasable together. The datais recorded into a block page by page, where all logical sectors withineach page are programmable together. The example shows a single-sectorpage with each sector typically of size about 512 byte. At someinstance, an ‘original’ block 10 is formed with an entire logical groupof sectors stored in it according to a predetermined order, such asordered in ascending logical sector numbers. Such as block is regardedas an intact block having intact all sectors of the logical grouppreferably in sequential order.

Thereafter, when a host sends updates as latest versions of some ofthese logical sectors of the logical group, the updated sectors arewritten to an update block 20 dedicated to the logical group. If theupdate data turns out to be in the predetermined order, it could berecorded in the update block sequentially. The update block is regardedto be a sequential update block with the potential of becoming an intactblock. On the other hand, when update sectors are not in sequentialorder, the update block is regarded as non-sequential, or “chaotic”. Inthis case, any latest version of sectors will eventually be copiedelsewhere to form a new intact block.

In host write #1, updated logical sector LS10′ is sent to the memory andrecorded in page 0 of the update block 20. In host write #2, updatedlogical sector LS11′ is sent to the memory and recorded in the nextavailable location, page 1, in the update block 20. In host write #3,updated logical sectors LS6′ and LS7′ are recorded in pages 2 and 3respectively. Finally, in host write #4, updated logical sector L10″ issent to the memory and recorded in page 4 of the update block. Theupdating of the logical group is said to form a stream, e.g., STREAM 1,with the update data streaming to the update block from the host. Ingeneral, if there are multiple versions of a logical sector distributedamong the original block and the update block, only the most recentlywritten version will be the valid one that renders all previous versionsobsolete. For example, FIG. 24 shows LS10″ recorded in page 4 of theupdate block, being the most recently written version, and therefore isthe current valid sector for the data of logical sector number 10. Theprevious versions, LS10 in the original block 10 and LS10′ in the updateblock 20 are obsolete.

Eventually, the update block will be closed out and the valid sectors(latest version of logical sectors) between the update block and theoriginal block will be consolidated in the predetermined order to form anew original block. The obsolete original block and update block will berecycled.

FIG. 25 illustrates the same sequence of writes shown in FIG. 24 asapplied to a memory where the pages are multi-sector and possiblyonce-writable. The example page structure differs from that shown inFIG. 24 in that each page now contains four sectors instead of one and,in some embodiment, can only be written once after an erase. In keepingwith existing terminology, a memory device-imposed minimum unit ofprogramming will be referred to as a ‘physical page’ whereas asystem-imposed minimum unit of programming will be referred to as a‘metapage’, which may be constituted from multiple physical pages. Forexpediency, ‘metapage’ and ‘page’ will be used interchangeable unlessotherwise stipulated.

As before, each logical sector is originally stored sequentially inascending logical number order in an original block 10. If the block hasa four-sector page structure, then the block will be further partitionedinto pages and each logical sector preferably have a definite pageoffset in each page. For example, page P0 has logical sectors LS0-LS3stored in it. Thus LS0 is stored in the first of the four slots of thepage and LS1 is stored in the second slots, etc. In the four-sector pageexample, the page offset for a given sector LSn will be given by MOD[(n+1),4] if the first logical sector of the block is numbered as LS0.

Each time a host writes to a memory, it issues a write command to writea number of data units, typically logical sectors, followed bytransmission of the logical sectors themselves. To prevent loss of data,the protocol between the host and the memory is such that the next hostwrite will not commence until after the current write data has beensuccessfully written to memory.

As explained earlier, in a memory architecture with multi-sector pages,it is preferable to implement sector alignment in a page as this avoidthe need for re-alignment during garbage collection. Thus, the sectorsreceived from each host write, when aligned, do not necessary fill anintegral number of pages in an update block. This could result in apartially filled page being programmed. The partially filled page couldhave gaps before or after the host data. These gaps can also bepre-padded or post-padded with existing logical sectors in order topreserve the sequential order as much as possible. It is generallypreferably not to post-pad the partial page in case the next host writeis the next logical sector. However, in the case of a memoryarchitecture with once-writable pages, there is no option of rewritingthe unfilled portion of a partial page once it has been written.

In the examples the number of valid pages in one of the update streams(SPB) has been optionally limited to one. This is enough to illustratethe principle, but it should be noted, that more than one page can bestored in SPB, where more information (older Write-pointers for example)need to be analysed in order to find the latest written sectors.

For example in FIG. 25, in host write #1, updated sectors LS10′ isstored in the third offset of the page P0 of the update block 20.Optionally, for completeness the first two slots can be padded withvalid data such as LS8 and LS9 from the original block 10. However, thisstill leaves the fourth slot unfilled when the page P0 is saved at theend of the host write #1. The partial page can be optionally post-paddedwith the latest version of LS11. Since the page is once-writable, theunfilled fourth slot will be closed to further programming.

In host write #2, the command is to write the received updated sectorLS11′ which turns out to be in sequential order from the last sectorLS10′. Ideally, this should be recorded in the next slot after LS10′ inP0. However, P0 is closed to further writes and therefore, LS11′ isstored in the next empty page P1 at the last slot, which is its properpage offset. The first three slots of P1 are padded with LS8, LS9 andLS10′, which are valid versions of logical sectors that sequentiallyprecede LS11′.

In host write #3, the command is to write LS6′ and LS7′. These arewritten to P2, which is the next empty page in the update block, at thethird and fourth slots respectively. The first and second slots arepadding with valid data such as LS4 and LS5.

Finally, in host write #4, the command is to write LS10″ and this isstored in P3, slot 3, while slots 1 and 2 are padded with LS8 and LS9respectively and slot 4 is left empty.

It can be seen that the update block is used inefficiently with muchpadding and dead spaces while trying to maintain sector alignment withineach once-programmable page. An undesirable feature is that even if thehost writes sequentially (sector 10, then 11 in two separate writecommands) the update block stops being sequential, and cannot becomeintact, as it has some obsolete data.

In order to avoid the above-mentioned problems and to minimizeinefficient storage in the update block 20 due to partially filledpages, as well as excessive padding, it has been described earlier touse an additional scratch pad block 30. The scratch pad block (SPB) 30serves as a temporary buffer and staging area for incoming data so thata full page of data could be staged before being written to an updateblock 20. In the four-sector page example above, the sectors are stagedso that four sectors are written to completely fill a page in the updateblock. In the case when the host writes sequential data in separatewrites, the SPB allows to buffer the partial page writes and keep theupdate block sequential. However, it also means that valid data may nowdistribute over the SPB in addition to the original and update blocks.

For expediency, the page size of the scratch pad block is the same asthat of the update block, although in general they can be different. Forexample, the pages of the scratch pad block can have the size of aphysical page if the memory system supports programming at the physicalpage level.

Scratch Pad and Update Block Index Management

U.S. patent application Ser. No. 10/917,725 filed Aug. 13, 2004discloses a memory system with block management, which entire disclosureis hereby incorporated herein by reference. The block managementprovides an update block to be associated with each logical group ofdata under update. Disclosed are examples of various indexing schemes tolocate valid data that may reside either on the original block or theupdate block. In particular, when the update block contains logicalsectors in non-sequential order, it is considered to be a “chaoticupdate block” A chaotic update block index (“CBI”) is used to keep trackof the logical sectors recorded in the chaotic update block.

SPBI/CBI Indices Saved in a Scratch Pad Block

According to another aspect of the invention, when a scratch pad blockis employed in addition to an update block, an associated scratch padblock index (“SPBI”) is used to keep track of the update sectorsrecorded in the scratch pad block. This is in addition to an index(e.g., “CBI”) used to keep track of the logical sectors recorded in theupdate block. Whenever user data is stored in a partial page of thescratch pad block, it means that at least the last slot of the page isunfilled. In one embodiment, the SPBI can be stored in the last slot ofthe partial page in the scratch pad block. In a preferred embodiment,the SPBI and the CBI can be packaged within a SPBI/CBI sector and storedat the last slot of a partial page in the scratch pad block which isunused anyway. Every time a new partial page is written, an updatedSPBI/CBI sector is written at the end slot, rendering all previousversions obsolete.

FIG. 26 is a flowchart illustrating a method of updating data byemploying a first memory block in conjunction with a second memoryblock, with an index of the stored data saved in the second block,according to a general embodiment of the invention.

STEP 80: Providing first and second nonvolatile storages, each forsequentially recording data.

STEP 81: Maintaining at least one index of data that has been recordedin first and second nonvolatile storages.

STEP 82: Receiving input data.

STEP 84: Determining if a first predetermined condition is satisfied forrecording the buffered input data to the first storage. If satisfied,proceeding to STEP 85, otherwise proceeding to STEP 86.

STEP 85: Recording the buffered input data to the first storage.Proceeding to STEP 88.

STEP 86: Recording the buffered input data together with the at leastone index to the second storage. Proceeding to STEP 88.

STEP 88: Proceeding to STEP 72 if there are more input data to beprocessed, otherwise ending process.

FIG. 27A illustrates a specific example of updating data and maintainingindices by employing an update block in conjunction with a scratch padblock, according to a preferred embodiment of the invention. Each blockis a metablock where all its memory locations are erasable together. Theblock is organized into pages where all memory locations within a pageare programmable together. Furthermore, each page has a size that storesmore than one sector and is once-writable each time the block has beenerased.

A scratch pad block (“SPB”) 30 is provided in addition to the updateblock (“UB”) 20. If ‘STREAM 1’ is used to label the flow of data to theupdate block 20, the corresponding flow to the scratch pad block 30 willbe labeled as ‘STREAM 0’.

The same host writes example in FIG. 24 and FIG. 25 will be used toillustrate the advantage of the invention shown in FIG. 27A. In hostwrite #1, the command is to write LS10′. Since LS10′ should occupy slot3, a full page could not be written to the update block 20. Instead, itis staged by being buffered in a new page of the SPB 30. Thus, LS10′ isstored in slot 3 of the next available partial page PP0 of the SPB 30.At the same time, slots 1 and 2 are optionally padded with LS8 and LS9respectively. Also, according to the feature of the invention, both theSPBI and the CBI are packaged within a sector, namely, an index sectorSPBI/CBI₁ 50, and the index sector 50 is advantageously stored in thelast, unused slot of the partial page PP0.

In host write #2, the command is to write LS11′. Since LS11′ belongs toslot 4, which is at a page end, a full page pre-padded with sequentialLS8, LS9 and LS10′ from the SPB 30 can be written to the next availablepage P0 of the update block 20. In this case, the index sector forSPBI/CBI is not updated since it is not writing to a partial page in theSPB 30. Alignment, as well as pre-padding in SPB is preferred butoptional.

In host write #3, the command is to write LS6′ and LS7′. They belong toslots 3 and 4 respectively. Thus, another full page, PI of the updateblock 20 is written when the preceding slots are padded with LS4 andLS5. Again, the index sector for SPBI/CBI is not updated since it is notwriting to a partial page in the SPB 30.

In host write #4, the command is to write LS10″. Since LS10″ belong toslot 3, it will be written to the next partial page PP1 of the SPB 30.Similarly, the preceding slots 1 and 2 are padded with LS8 and LS9,while the last slot will also be stored with the latest update of theindex sector, SPBI/CBI₃.

The scheme shown in FIG. 27A is a more efficient utilization of theupdate block as evident from comparing the usage of the update block 20at the end of host write #4 with that of FIG. 25. For the same hostwrites, the scheme shown in FIG. 27A consumes less storage and requiresless padding in the update block, albeit at the expense of the scratchpad block 30. At the same time, the indexing scheme takes advantage ofthe unused storage in the scratch pad block to store an index innonvolatile memory.

One important feature and advantage of the invention is that sequentialorder of update sectors in the update block is maintained during aseries of separate host writes of sequential logical sectors, unlike theexample shown in FIG. 25. This will be evident from the exampleillustrated in FIG. 27B.

FIG. 27B illustrates another example of the sequential ordering ofupdating data being maintained by employing an update block inconjunction with a scratch pad block, according to a preferredembodiment of the invention. In this example, logical sectorsLS10′-LS16′ are written in sequence but over a number separate hostwrites.

In host write #1, LS10′ is written. Since it should occupy slot 3 of apage which is not a page-end slot, it is recorded in slot 3 of a scratchpad block 30. At the same time, an index SPBI/CBI1 is recorded in thepage-end slot.

In host write #2, LS11′ is written. Since it should occupy a page-endslot, it is recorded directly to the last slot of a new page in anupdate block 20. At the same time, the LS10′ temporarily stored in thescratch pad block is copied over to slot 3, while slots 1 and 2 arepre-padded with LS8 and LS9 from the original or intact block 10.

In host write #3, LS12′-LS14′ are written. Since none of them has anend-page offset, they are stored in slots 1-3 of a new page in thescratch pad block. At the same time, an updated index SPBI/CBI3 isrecorded in the page-end slot.

In host write #4, LS15′ and LS16′ are written. Since LS15′ falls in apage-end slot, it is written directly to the last slot of the next pagein the update block. At the same time, slots 1-3 are respectively filledwith LS12′-LS14′ from the scratch pad block.

It will be seen that the sequential logical sectors LS10′-LS16′ arerecorded in the update block in a sequential manner even though they arewritten over several separate host writes.

In the preferred embodiment, one valid partial page (e.g., the lastwritten partial page) is maintained per logical group in the scratch padblock. The invention is equally applicable to having more than one validpartial page maintained per logical group in the scratch pad block. Inthat case, the index information from more than one page need to beanalyzed in order to locate the recorded sectors.

Sector alignment and padding within the page of a scratch pad block ispreferable but optional. The alignment and padding will facilitatesubsequent transfer to the update block.

Absolute sector alignment within a page of an update block will simplifyindexing and copying in some memory architecture. The sectors in thepage are also regarded as page-aligned even when all the sequentialsectors in the page are cyclically shifted by some number of slots. Inthat case, a page tag indicating the location of the first logicalsector in the page will provide the offset address.

The preferred embodiments shown have the two storages as two differenterasable blocks. In general the invention is equally applicable to thetwo storages being two portions of the memory.

The invention is also equally applicable to two-state memories havingeach memory cells storing one bit of data and multi-state memorieshaving each memory cells capable of storing more than one bit of data.For multi-state memories that support multi-page storage, the lower pageis preferable used for storage operation of the scratch pad block. Thepartial page is preferably pre-padded if the first sector to write doesnot start from the slot 1 location of a multiple-slot page.

Page level indexing is used for chaotic blocks and sector-level indexingfor the scratch pad block. All necessary indexing information foraccessing all chaotic blocks and the scratch pad block, i.e., SPBI/CBI,is maintained in the controller SRAM for speedy access and processing.It is periodically written out to the scratch pad block whenever a newpartial page is written.

Generally, partial meta-page relocated data is programmed together withincoming data to reduce the number of programming cycles. A scratch padblock (SPB) is compacted when it becomes full. The SPB compaction is therelocation of all valid data to a new block. As we have only one pagewith valid data per UB in SPB, we only need to copy those pages to newblock. If there are multiple pages with valid data per update block(they might contain different or the same logical addresses; in thelatter it is preferable to consolidate them).

Update Block Index Saved in Partial Page

According to yet another aspect of the invention, data stored in amemory block has its index stored in a portion of a partial pageunoccupied by data. Thus, in a memory organized into memory units wherea page of memory units is programmable together and a block of memorypages is erasable together, partially filled pages will exist when dataunits stored in the memory units are aligned in the page according to apredetermined order, and especially if the page is once-programmableafter each erase. The index for the block is then stored in a partialpage not filled with update data. The partial page may be in the currentblock or in another block.

FIG. 28 illustrates a preferred scheme for saving an index of a memoryblock for storing update data in a partial page of the block.

STEP 90: Organizing a nonvolatile memory into erasable blocks of memoryunits, each memory unit for storing a logical unit of data, and eachblock also organized into one or more pages, with the memory units ineach page having predetermined page offsets and being once programmabletogether after an erase

STEP 92: Providing a block as an update block for recording updateversions of logical units of data.

STEP 94: Receiving logical units of data from a host.

STEP 96: Maintaining an index for data in the update block.

STEP 98: Recording to the update block, page by page, with the receiveddata aligned in the page according to their page offsets, and when thepage to be recorded has a portion unoccupied by data, also recording theindex to the portion unoccupied by data.

Multi-Stream Tracking and Synchronization

FIG. 29 illustrates schematically, a scratch pad block used in amulti-stream update in which several logical groups are concurrentlyundergoing updates. For example, if there are k logical groupsundergoing updating, there will be k update streams using k updateblocks 20-1, . . . , 20-k. In order to avoid partial pages among theupdate blocks, a scratch pad block 30 is used in another stream (stream0) to buffer data in k corresponding partial pages for the k updateblocks. Thus, there will be k+1 blocks opened, and k partial pages toservice the concurrent updating of k logical groups of logical units ink update blocks. The example shown is for the preferred embodiment wherethere is one valid page per update block in the scratch pad block.

With valid sectors distributed among the update and scratch pad blocks,a problem may arise in identifying the most recently written version ofsectors in the case of power cycles as different copies of the samelogical sectors can be found in both the update and scratch pad blocks.A memory scan on the update block after a power reset will establish thepriority of multiple versions (if any) of a logical sector since thelocations of the update block is filled in a definite order. Similarlyscanning the scratch pad block, the last written version of a logicalsector can be identified. However, if there is a latest version in thescratch pad block and a latest version in the update block, it is notreadily determined which one is the very latest. For example, in FIG.27A the sectors LS8-LS10 can be found in both streams. The same patternof data, as on FIG. 27A, can be created by different commandsequence—write LS8′-LS10′; write LS8″-LS10″; write LS8′″-LS11′″; writeLS4′-LS7′. In this case the valid sectors will be located in the updateblock rather than the scratch pad block.

According to another aspect of the invention, a method is provided towrite update data to a non-volatile memory with synchronizationinformation that allows identifying the most recently written version ofdata that may exist on multiple memory blocks.

FIG. 30 illustrates a conventional case of writing a sequence of inputdata to a block. The nonvolatile memory block 22 is organized such thatit is filled in a definite order. It is shown schematically as fillingfrom the top. Thus, successive write of segments of data “A”, “B”, “C”and “A′” are laid down in the block sequentially. In this way, if forexample, “A′” is another version of “A”, it can be determined from itsrecorded location in the block 22 that it is a later version thatsupersedes “A”. The embodiments below are just special, thougheffective, cases of the broader idea of storing information about howfull the streams were at the time of update of one definite stream.

FIG. 31A illustrates a scheme of keeping track of the recording order orpriority even when the different writes are interleaved over two blocks,according to a preferred embodiment of the invention. Each write, suchas data segments “A”, “B”, “C” and “A′” could either be recorded onto afirst block (e.g., block 22) or a second block (e.g., block 32)depending on one or more predetermined conditions. In the example, “A”is recorded in a first write to the second block 32. This is followed bya second write where “B” is recorded to the first block 22, and a thirdwrite where “C” is recorded to the second block 32, and finally a fourthwrite where “A′” is recorded to the first block 22.

In the figure shown, STREAM 0 is the stream of data recording to thesecond block 32 and STREAM 1 is the stream of data recording to thefirst block 22. In the case of interleaved update of the same logicaldata in two or more streams, it is essential to keep track of theprioity of updates, which defines the locations of the most recentlyrecorded data. In a preferred embodiment, this is accomplished by savingthe prioity information at least every time a given stream is beingrecorded.

The priority information is being saved with the write data every timethe latter in STREAM 0 is being recorded onto the block 32. In thepreferred embodiment, the priority information is a write pointer 40that points to the next empty location (i.e., the address of the nextrecording location) in the first block 22. The write pointer is savedalong with the data that is being stored in STREAM 0.

Thus, in the write “A” operation, a pointer PA 40-A that points to thenext empty location in block 22 is saved together with “A” in the block32 in STREAM 0. In the write “B” operation, no pointer is saved sincethe write is to the block 22 in STREAM 1. In the write “C”, a pointer PC40-C is saved with “C” in the block 32 in STREAM 0. In the write “A′” tothe block 22, no pointer is being saved in STREAM 1.

If at the end of write “A′” , the memory is reset after a powerinterruption, any indices in the controller RAM will be lost and have tobe rebuilt by scanning the memory. By scanning backwards, each of theblocks 22 and 32 will have located a last written version of data “A”.The write pointer 40 can be used to determine the very latest versionbetween the two blocks. For example, the pointer PC points to a locationin the block 22 prior to the recording of “A′”, hence “A′” is recordedafter “C”. Also, since “C” is recorded in the block 32 at a locationafter “A”, it therefore can be concluded that “A′” is the later versionof “A”.

In another embodiment where there are more than one valid page in theSPB per UB, then in order to detect the most recently written data, morethan one write pointer will have to be analyzed.

FIG. 31B illustrates another embodiment of keeping track of therecording order when the writes are recorded over two blocks. Thisembodiment is similar to that shown in FIG. 31A except the write pointerpoints to the next empty location in the block 32 and is saved in theblock 22. STREAM 0 is being recorded to a second block (e.g., block 32)while STREAM 1 is being recorded to a first block (e.g., block 22).Every time STREAM 1 is being recorded onto a first block, a second-blockwrite pointer 40′, that gives the address of the next recording locationin the second block 22, is being saved with it. In this example, thepointers P′_(B) 40′-B is being recorded with “B”. Similarly, the pointerP′_(A), 40′-A′ is being recorded with “A′” in the first block 22 inSTREAM 1.

FIG. 32A is a flowchart illustrating a method of synchronizing therecording sequence between two data streams, according to a generalembodiment of the invention.

STEP 100: Providing first and second nonvolatile storages, each forsequentially recording data.

STEP 102: Designating either the first or second storage as the storagefor priority information, the priority information being used todetermine whether a first data unit in the first storage was recordedbefore or after a second data unit in the second storage.

STEP 110: Receiving the input data.

STEP 120: Determining if a predetermined condition is satisfied forrecording the received input data to the first storage. If satisfied,proceeding to STEP 130′, otherwise proceeding to STEP 140′.

STEP 130: Recording the received input data to the first storage. At thesame time, if the first storage is the designated storage, additionallyrecording the priority information to the first storage. Proceeding toSTEP 150.

STEP 140: Recording the received input data to the second storage. Atthe same time, if the second storage is the designated storage,additionally recording the priority information to the second storage.Proceeding to STEP 150.

STEP 150: Proceeding to STEP 110 if there is more input data to beprocessed, otherwise ending process.

In a preferred embodiment, the priority information is a writer pointer,which is an address of the location of where a next recording will takeplace in the non-desingated storage.

FIG. 32B is a flowchart illustrating a method of synchronizing therecording sequence between two data streams, according to an embodimentusing a write pointer.

STEP 100′: Providing first and second nonvolatile storages, each forsequentially recording data.

STEP 110′: Receiving the input data.

STEP 120′: Determining if a predetermined condition is satisfied forrecording the received input data to the first storage. If satisfied,proceeding to STEP 130′, otherwise proceeding to STEP 140′.

STEP 130′: Obtaining an address of the location where a next recordingwill take place in the second storage.

STEP 132′: Recording the address and the received input data to thefirst storage. Proceeding to STEP 150′.

STEP 140′: Recording the received input data to the second storage.Proceeding to STEP 150′.

STEP 150′: Proceeding to STEP 110 if there is more input data to beprocessed, otherwise ending process.

The invention is particular applicable to a nonvolatile memory that isorganized into erasable blocks of memory units, each memory unit forstoring a logical unit of data, and each block also organized into oneor more pages. Furthermore, each page is once programmable after anerase with multiple logical units, each logical unit in a predeterminedorder with a given page offset. The method essentially provides twoblocks (e.g., an update block and a scratch pad block) for storing orbuffering update data of a group of logical units, and maintainssynchronization information for helping to identify whether the mostrecently written version of a logical unit is located in the first orsecond block. With regard to FIG. 29, the embodiment shown in FIG. 31Ais preferable if there are multiple streams, since it is more convenientto have all write pointers stored in one place in the SPB.

Update-Block Write Pointer Embodiment

Accordingly to a preferred embodiment, the synchronization informationin the form of a write pointer is saved together with host data everytime it is being buffered in a scratch pad block. The write pointer isan update-block write pointer that gives the address of the location forthe next write in the update block at the time the write pointer issaved in the scratch pad block. In particular, it is saved in a portionof the scratch pad block not utilized for storing host data anyway.Preferably, the update-block write pointer is included in the indexSPBI/CBI stored in a partial page of the scratch pad block. Theupdate-block write pointer would allow determination of whether a givenlogical sector buffered in the scratch pad block has been renderedobsolete by subsequent writes to the update block.

If there is a power reset, and two versions of the logical sector inquestion are found among the two blocks, then the write pointer willallow resolution of which version is the very latest. For example, ifthe logical sector in the update block is recorded after the pointedlocation, it will supersede the version in the partial page in the SPB.On the other hand, if the logical sector is not found in the updateblock or was recorded at an earlier location, the conclusion will thenbe that the version buffered in the partial page of the scratch padblock is still valid.

FIG. 33A shows the state of the scratch pad block and the update blockafter two host writes #1 and #2 according to a first sequence. The firstsequence is for host write #1 to write LS10′, and host write #2 to writeLS10″ and LS11′.

In host write #1, the command is to write LS10′. Since LS10′ is not at apage boundary, it is recorded in a partial page PP0 in the scratch padblock 30 pre-padded with LS8 and LS9 and terminated with the currentindex SPBI/CBI₁. When the partial page PP0 is written, a write pointer40 is included in the current index SPBI/CBI₁ 50, which is saved in thelast slot. The write pointer 40 points to the first empty page P0 in theupdate block 20.

In host write #2, the command is to write LS10″and LS11. Since LS11′ isat a page end, it is written directly to the last slot (slot 4) of P0 inthe update block 20. At the same time, slot 3 is written with LS10′ andslots 1 and 2 are padded with LS8 and LS9 respectively.

If the memory now suffers a power interruption with the loss of indexinginformation maintained in RAM, a backward scan of the physical memorywill attempt to rebuild the indexing information. It will be seen thatboth the update block and the scratch pad block (SPB) will yield theirlatest versions of LS10, namely, LS10′ and LS10″. However, since LS10″is recorded after the write pointer recorded in PP0 of the SPB, it canbe concluded that it is a later version than LS10′.

FIG. 33B shows the state of the scratch pad block and the update blockafter two host writes #1 and #2 according to a second sequence which isthe reverse of the first sequence shown in FIG. 33A. The reversesequence is for host write #1 to write LS10′ and LS11′, and host write#2 to write LS10″.

In host write #1, the command is to write LS10′ and LS11′. Since LS11′is at a page end, it is written directly to the last slot (slot 4) of P0in the update block 20. At the same time, slot 3 is written with LS10′and slots 1 and 2 are padded with LS8 and LS9 respectively.

In host write #2 that follows host write #1, the command is to writeLS10″. Since LS10″ is not at a page boundary, it is recorded in apartial page PP0 in the scratch pad block 30 pre-padded with LS8 and LS9and terminated with the current index SPBI/CBI₂. When the partial pagePP0 is written, a write pointer 40 is included in the current indexSPBI/CBI₂ 50, which is saved in the last slot. The write pointer 40points to the next empty page P1 in the update block 20.

In this case, after a power reset, the logical sector LS10′ in theupdate block, for example, is found to be recorded before the pointed-tolocation of the update block 20. It can then be concluded that thelatest version of LS10′ in the update block 20 is superseded by anotherversion LS10″ that resides in the partial page of the scratch pad block30.

FIG. 34A illustrates a preferred data structure of the scratch pad blockindex (SPBI). The SPBI information contains the following fields foreach of k update blocks. This is a special case of SPB with one validpage per Logical Group/UB.

A Logical Group Number identifies the logical group undergoing update ina given stream. Preferably, the null value “FFFF” is stored for freeupdate blocks, or update blocks with no valid scratch pad data.

A Page Starting Sector is the first logical sector of the partial pagewritten to the scratch pad block.

A Sector Run Length is the number of valid sectors of the partial pagewritten to a scratch pad page.

A Valid Page Number identifies the only valid (the only valid) partialpage written in the scratch pad block. This will be the last writtenpartial page in the scratch pad block. Alternatively, the addressing canbe implemented with sector offset, which points to the first validsector of the partial page for an update block. The sector offset iscounted relative to the beginning of the block. In the preferredembodiment, only one physical page contains valid data for a givenupdate block. FFFF is stored for sectors not written to the Scratch PadBlock.

An Update-Block Write Pointer 40 is the sector address of the firstunwritten sector location of the corresponding Update Block when theScratch Pad was last written. Any sectors written to the Update blockfrom this sector position would supersede sectors written in the ScratchPad Block.

FIG. 34B illustrates example values in the Scratch Pad Block Index forthe host write #1 shown in FIG. 33A. In this example, the Logical GroupNumber is “1”, which contains logical sectors LS0 to LSN-1. It is beingupdated in STREAM 1 with an accompanying update block and a scratch padblock. The partial page is PP0 and it starts with LS8 or “8” and has arun of “3” to end with LS10′. The valid partial page number is “0”.Finally, the write pointer points to the next write location in theupdate block, which has a sector offset of

It will be clear that if the updated index is only stored in the scratchpad block, and the scratch pad block does not get written whenever datais written directly to the update block, the index will become invalidunder those circumstances.

Generally, the entire SPB index information as well as the CBI indexinformation is maintained in data structure in controller SRAM at alltimes. Valid sectors in the SPB are accessed based on the sector-levelindex information. In the preferred embodiment, the SPBI/CBI indices arestored in non-volatile memory in the scratch pad block. In particularevery time a partial page is written in the scratch pad block (SPB), theup-to-date SPBI/CBI is stored in the last sector of the partial page.

The SPB supports up to a predetermined number (e.g., 8) of updateblocks. Partial page data in the SPB block is consolidated to theassociated update block when the host writes the last sector of thepage. Data may exist in more than one partial page in the SPB for alogical group at a given instance but only the data for the last writtenpartial page is valid. Similarly, multiple copies of a SPBI/CBI sectorcan exist in the SPB but only the last written copy is valid. Whensectors need to be written to the SPB and the SPB is full, the block isfirst copied to a new SPB block and the old SPB is erased, after whichthe sectors are written to the new SPB. SPB is also written whenSPBI/CBI needs to be updated because a sequential update block becomeschaotic, or because an update block, previously containing scratch paddata, is closed.

In the preferred embodiment, the scratch pad block (SPB) write is onepage at a time. The number of pages per stream/Logical.Group/UpdateBlock is also limited to one, so only the latest SPBI is needed, asthere is only one logical page which mayb be in question regarding wherethe valid copy is in the UB or SPB. Similarly, if the number of pagesper UB in SPB is more than one, then the old SPBIs would need to beanalyzed as well.

The embodiment described above stores an update-block write pointer aspart of the SPBI/CBI sector in the latest partial page of the scratchpad block. Alternative embodiments are possible to identify the validversion of a logical sector from multiple versions that may exist amongmultiple blocks. Also it is possible to have either more than one pageper stream in the scratch pad block, or if we have more than one updateblock or stream per logical group.

Scratch-Pad-Block Write Pointer Embodiment

According to another embodiment of the invention, synchronizationinformation is maintained that would allow determination of whether agiven logical sector buffered in the scratch pad block has been renderedobsolete by subsequent writes to the update block. This is accomplishedby including a scratch-pad write pointer that gives the address of thelocation for the next write in the scratch pad block at the time thesynchronization information is stored in a page of the update block.

FIG. 35A and FIG. 35B shows the intermediate state of the scratch padblock and the update block relative to the scratch-pad write pointerrespectively after the successive host writes of FIG. 33A and FIG. 33B.

FIG. 35A illustrates the state of the scratch pad block and the updateblock after host write #1. In host write #1, the logical sector LS 10′belongs to slot 3 of the page and not at a page boundary and istherefore recorded in a partial page PP0 in the scratch pad block 30. Itis optionally pre-padded with LS8 and LS9 and terminated with thecurrent index SPBI/CBI₁. If the memory has since been restarted after apower shut down, the valid version of the logical sector LS10′ will becorrectly located by the last SPBI/CBI₁ index. This is true sincenothing has been written to the update block 20.

FIG. 35B illustrates host write #2 that follows host write #1, where thecommand is to write LS11′. Since LS11′ falls at a page boundary (slot4), it is recorded in the fourth slot of a filled page P0, pre-paddedwith LS8, LS9 and LS10. Synchronization information is in the form of aSPB write pointer 40′ that points to the next empty location in the SPB30. Unlike the earlier embodiment, the SPB write pointer 40′ is notincluded in the SPBI/CBI index in the SPB 30. Instead, it is stored in aheader portion of a sector in the page currently being recorded to inthe update block 20. If the memory has since been restarted after apower shutdown, the valid version of the logical sector LS10′ will becorrectly located in the update block 20 since the version of LS10 inthe SPB is recorded before the location pointed to by the SPB writepointer 40′.

FIG. 36 illustrates the scratch-pad write pointer being stored in anoverhead portion of a sector being recorded to the update block. Thescratch-pad write pointer 40′ is saved in at least one of the sectors inthe page currently being recorded to the update block. In the preferredembodiment, it is saved in an overhead portion of at least one of thesectors in the page being written.

Time Stamp Embodiment

In yet another embodiment, the synchronization information can beencoded as time stamps for data sectors written to multiple streams sothat the latest version can be correctly found.

FIG. 37 illustrates the use of time stamps to keep track of therecording sequence between two update streams. As before, each segmentof the update data can be recorded in either a first block (STREAM 1) ora second block (STREAM 2). The example shows that at time T1, “A” isrecorded in the first block, at T2, “B” is recorded in the second block,at T3, “C” is recorded in the first block, and T4, “A′” is recorded inthe second block.

At least one time stamp for every new data update portion is stored.Thus, “A” with have the time stamp TS1, “B” with TS2, “C” with TS3 and“A′” with TS4. Thus, for example, “A′” is a later version of “A” sinceits has a later time stamp. In the preferred embodiment, the time stampinformation is stored in an overhead portion of at least one of thesectors in the page being written.

Multi-Stream Updating of Blocks Having Multi-Sector Pages

According to another aspect of the invention, a method of updating anonvolatile memory includes using a first block (update block) forrecording update data and a second block (scratch pad block) fortemporary saving some of the update data before recording to the updateblock. The nonvolatile memory is organized into erasable blocks ofmemory units, each memory units for storing a logical unit of data, andeach block also organized into one or more pages, with each page capableof storing multiple logical units having definite page offsets, andbeing once programmable together after an erase. The method furtherincludes receiving the logical units from a host and aligning thereceived logical units page by page, so that when a predeterminedcondition is satisfied where a received logical unit has a page endoffset, storing the received logical unit and any preceding logicalunits to a page in the update block with appropriate page alignment,otherwise, temporarily storing any remaining received logical units to apartial page in the scratch pad block. The logical units in the scratchpad block are eventually transferred to the update block when thepredetermined condition is satisfied.

In a preferred embodiment, the update data is received and parsed pageby page for transferring to the first block (e.g., update block). Anyremaining partial page of buffered data is transferred to the secondblock (e.g., scratch pad block) and will remain there until a full pageof data becomes available for recording to the first block. When thebuffered data is transferred to the second block, it is recorded page bypage, albeit the recorded page is only partially filled with thereceived data. The spare, normally unused, space in the partial page isused to store an index for locating the data in the second and firstblocks.

FIG. 38 is a flowchart illustrating a method of recording and indexingupdate data to two memory blocks concurrently, each memory block havingmultiple-sector pages, according to a general embodiment of theinvention.

STEP 200: Organizing a nonvolatile memory into erasable blocks of memoryunits, each memory unit for storing a logical unit of data, and eachblock also organized into one or more pages, with each page containingmultiple memory units and being once programmable together after anerase.

STEP 210: Providing a first block for recording full page by full pageupdate versions of logical units of data.

STEP 220: Providing a second block for buffering update versions oflogical units of data received from a host.

STEP 232: Receiving data in logical units from a host

STEP 234: Parsing the received logical units page by page by locatingany logical units with a page-end offset;

STEP 236: Recording each of the logical units having a page-end offsetto a new page in the first block while filling the new page with latestversions of preceding logical units, and recording any remainingreceived logical units in a partial page in the second block

FIG. 39 is a flowchart illustrating a more specific implementation ofthe method of FIG. 37 employing a scratch pad block and an update block.

STEP 310: Providing an update block (UB) for recording update versionsof logical units, full page by full page, each logical unit having apredetermined page offset according to a predetermined order.

STEP 322: Providing a scratch pad block (SPB) for temporarily bufferingupdates directed thereto page by page.

STEP 324: Providing a SPBI index for locating valid (latest version)data in the SPB.

STEP 332: Receiving the data of a current write request logical unit bylogical unit.

STEP 334: If the current logical unit is offset at page end, thenproceed to STEP 340, otherwise proceed to STEP 336.

STEP 336: If the write request has more data to be received, thenproceed to STEP 332, otherwise proceed to STEP 350.

STEP 340: Recording a new page of the UB with the current logical unitat page end and filling the rest of the page with valid (latestversions) logical units according to the predetermined order. Proceed toSTEP 336.

STEP 350: If all received data has been recorded, then proceed to STEP180, otherwise proceed to STEP 360.

STEP 360: If unrecorded received data does not belong to the same pageas any existing valid (latest version) data in the SPB, then proceed toSTEP 370, otherwise proceed to STEP 362.

STEP 362: Updating the SPB Index.

STEP 364: Recording into a new page of the SPB the unrecorded receiveddata and any existing valid data at their page offsets, terminating withthe SPB index. Proceed to STEP 380.

STEP 370: Relocating existing valid data from current page of SPB to anew page of the UB by consolidation.

STEP 372: Updating the SPB Index.

STEP 374: Writing into a new page of the SPB the unrecorded receiveddata at its page offsets, terminating with the SPB index.

STEP 380: End of the Current Write Request.

The SPB supports up to a predetermined number (e.g., 8) of updateblocks. Partial page data in the SPB block is consolidated to theassociated update block when the host writes the last sector of thepage. Data may exist in more than one partial page in the SPB for alogical group at a given instance but in the preferred embodiment onlythe data for the last written partial page is valid. Similarly, multiplecopies of a SPBI/CBI sector can exist in the SPB but only the lastwritten copy is valid. By the same consideration, only the last writepointer is needed if the number of valid pages per UB in SPB is limitedto one. When sectors need to be written to the SPB and the SPB is full,the block is first copied to a new SPB block and the old SPB is erased,after which the sectors are written to the new SPB. SPB is also writtenwhen SPBI/CBI needs to be updated because a sequential update blockbecomes chaotic, or because an update block, previously containingscratch pad data, is closed.

In general, as noted before, more than one SPB partial pages for eachupdate block can be used to store valid data. In this way, the partialpage need not be consolidated to make way for a new one if the next hostwrites sector outside of the page.

The multi-stream updating scheme allows a more efficient utilization ofthe update block. This is especially true for block with multi-sectorpages that are once-writable. The scheme consumes less storage andrequires less padding in the update block. More importantly, sequentialorder of update sectors in the update block is maintained during aseries of separate host writes of sequential logical sectors.

Multi-Stream Update with Predictive Pipelined Operation

In the multi-stream updating scheme described above, every time there isa host write, decision will have to be made as to recording the receivedhost data either to the update block or the scratch pad block. The dataunits from the host could be monitored one by one as they are receiveduntil one with an end-page offset is received. At that point, thepredetermined condition is confirmed for writing a full page, albeitwith possible pre-padding.

In order to write to the update block, the page to be written need to beset up for programming. This involves addressing the page and thenloading the data for the page to the data latches.

According to a preferred embodiment, a predictive pipelined operation isimplemented in which, rather than waiting until the predeterminedcondition for recording to the update block is confirmed, the updateblock is set up to be written to as soon as the host write commandindicates the predetermined condition is potentially satisfied by thedata units intended to be written. In this way, the set up could have ajump start while waiting for the data units to come from the host. Whenthe actual data units received eventually do satisfy the predeterminedcondition, programming of the page in the update block can take placeimmediately without have to wait for setup, thereby improving writeperformance. In the event that the host write was interrupted and theactual data units received no longer satisfy the predeterminedcondition, the setup for recording to the update block will beabandoned, and instead the data units will be recorded to the scratchpad block.

FIG. 40A illustrates schematically a memory device having a bank ofread/write circuits, which provides the context in which the presentinvention is implemented. The memory device includes a two-dimensionalarray of memory cells 400, control circuitry 410, and read/writecircuits 470. The memory array 400 is addressable by word lines via arow decoder 430 and by bit lines via a column decoder 460. Theread/write circuits 470 is implemented as a bank of sense modules 480(not shown) and allows a group (also referred to as a “page”) of memorycells to be read or programmed in parallel. An entire bank of p sensemodules 480 operating in parallel allows a page of p cells along a rowto be read or programmed in parallel. One example memory array may havep=512 bytes (512×8 bits). In the preferred embodiment, the block is arun of the entire row of cells. In another embodiment, the block is asubset of cells in the row. For example, the subset of cells could beone half of the entire row or one quarter of the entire row. The subsetof cells could be a run of contiguous cells or one every other cell, orone every predetermined number of cells. Thus, in a preferredembodiment, a page is constituted from a contiguous row of memory cells.In another embodiment, where a row of memory cells are partitioned intomultiple pages, a page multiplexer 350 is provided to multiplex theread/write circuits 470 to the individual pages.

The control circuitry 410 cooperates with the read/write circuits 470 toperform memory operations on the memory array 400. The control circuitry410 includes a state machine 412, an on-chip address decoder 414 and apower control module 416. The state machine 412 provides chip levelcontrol of memory operations. The on-chip address decoder 414 providesan address interface between that used by the host or a memorycontroller to the hardware address used by the decoders 330 and 370. Thepower control module 416 controls the power and voltages supplied to theword lines and bit lines during memory operations.

FIG. 40B illustrates a preferred arrangement of the memory device shownin FIG. 40A. Access to the memory array 400 by the various peripheralcircuits is implemented in a symmetric fashion, on opposite sides of thearray so that access lines and circuitry on each side are reduced inhalf. Thus, the row decoder is split into row decoders 430A and 430B andthe column decoder into column decoders 460A and 460B. In the embodimentwhere a row of memory cells are partitioned into multiple blocks, thepage multiplexer 450 is split into page multiplexers 450A and 450B.Similarly, the read/write circuits are split into read/write circuits470A connecting to bit lines from the bottom and read/write circuits470B connecting to bit lines from the top of the array 400. In this way,the density of the read/write modules, and therefore that of the bank ofsense modules 480, is essentially reduced by one half. Data directed tothe read/write modules located at the top of the array will betransferred via the I/O at the top. Similarly, data directed to theread/write modules located at the bottom of the array will betransferred via the I/O at the bottom.

FIG. 41 illustrates in more detail the sense module shown in FIG. 40A.Each sense module 480 essentially includes a sense amplifier 482 forsensing a conduction state of a memory cell, a set of data latches 484for storing sensed data or data to be programmed, and an I/O circuit 486for communicating with the external. A preferred sense amplifier isdisclosed in United States Patent Publication No. 2004-0109357-A1, theentire disclosure of which is hereby incorporated herein by reference.

During a program operation, first, the selected word lines and bit linesare addressed. This is followed by transferring the data to be programvia an I/O port to the respective data latches. Then bit lines areprecharged before programming commences with the application ofprogramming voltages to the word lines. The steps preceding the actualapplication of the programming voltage can be regarded as program setup.When the page size is substantial, so will the time needed to transferthe program data into the data latches.

During a host write, the host first sends a host write commandindicating to the memory device the range of data units it intends towrite. This is then followed by transmission of data units in the range,data unit by data unit until the end of the range is reached. Dependingon protocol, it is possible that the transmission may be interruptedunexpectedly and the remaining data units be sent in a new writecommand.

To improve write performance, it would be desirable to have a pipelineoperation where the program setup process can take place while dataunits are still being received. However, in a multi-stream scheme wheredata units could be recorded to any of the multiple storages dependingon whether certain data units are received, the addressing to record toa given storage would not be certain until those certain data units areactually received without interruptions.

To overcome this problem, a predictive pipelining scheme is employed. Ifthose certain data units that cause a recording to a given storage arefound within the range indicated by the host write command, the givenstorage will immediately be set up for programming. When those certaindata units are actually received, the given storage will be in aposition to program the data units without the delay due to programsetup. On the other hand, if those certain data units fail tomaterialize due to interruptions, the program set for the given storagewill be abandoned, and instead another storage will be selected for setup and subsequent programming.

FIG. 42 is a flow diagram illustrating a multi-stream update employing apredictive pipelining scheme, according to a preferred embodiment.

STEP 500: Providing first and second storage for recording host dataunits. For example, the first storage is an update block which is anerasable block dedicated to storing update data, and the second storageis a scratch pad block which is another erasable block for temporarilybuffering update data in transit to the update block.

STEP 510: Receiving Host Write Command indicating the range of dataunits to be written.

STEP 512: If the range of data units contains ones that satisfies apredetermined condition for recording the data units to the firststorage, proceeding to STEP 520, otherwise proceeding to STEP 530. Forexample, the erasable block is organized into pages, each page capableof storing multiple data units that are programmable together. The dataunits are stored in a page in a logically sequential order so that eachdata unit has a predetermined page offset. The predetermined conditionfor recording to the update block is when a full page can be recorded. Asufficient condition is when a data unit with an end-page offset exists,where a full page is formed by pre-padding any preceding data unit inthe page if necessary. If the predetermined condition is not satisfied,the host data will be recorded to the scratch pad block.

STEP 520: Setting up addresses in preparation for recording to the firststorage. For example, if the range includes a data unit with an end-pageoffset, a full page will be assumed to be recorded to the update block.In which case, a new page in the update block will be addressed forrecording.

STEP 522: Loading the data latches with received data in preparation forrecording to the first storage. As soon as data units are received fromthe host, they will be loaded to the data latches for programming a newpage.

STEP 524: If the data units that satisfied the predetermined conditionare actually received, proceeding to STEP 540, otherwise proceeding toSTEP 526. For example, when the data unit with an end-page offset isactually received from the host, the predicted full page can definitelybe formed.

STEP 526: Aborting the setup to record to the first storage. Proceedingto STEP 530. For example, if the expected data unit with an end-pageoffset never arrives due to interruptions, the prediction for a fullpage to be recorded to the update block is no longer true. In that case,the program setup for the update block will have to be abandoned.Instead, the scratch pad block will now be set up for programming.

STEP 530: Setting up addresses in preparation for recording to thesecond storage. For example, when the predetermined condition for recorda full page to the update block is not satisfied, the host data will berecorded to the scratch pad block. In which case, a new page in thescratch pad block will be addressed for recording.

STEP 532: Loading the data latches with received data in preparation forrecording to the second storage. As soon as data units are received fromthe host, they will be loaded to the data latches for programming a newpage.

STEP 540: Program the data in the data latches to the addressed storage.For example, when the predicted recording to the update block or to thescratch pad block is confirmed by the data units received, the setupblock can be programmed without delay.

STEP 550: Ending Current Host Write.

Depending on memory architecture, the STEP 520 and 530 may be indifferent order, such as the addresses may be selected after the loadingof the data latches in STEP 522 or STEP 532.

In another preferred embodiment, as data is being received and whenthere is initially uncertainty in recording the received data whether tothe first or second storage, the received data is loaded to the datalatches of the programming circuits for both first and second storage.In this way, the data will always be immediately available forprogramming either the first or second storage. In a special case, thefirst and second storages share the same set of data latches. Forexample, when first and second storages are in the same memory plane,they could be served by the same set of programming circuits with thesame set of sense amplifiers and data latches. In that case, data willbe loaded to a set of default data latches irrespective of whether firstor second storage is to be programmed.

In the case where the first and second storages are served by differentsets of data latches, as for example in the cases of being in differentmemory pages of the same plane or in different memory planes, the datacould be loaded to both sets of data latches.

FIG. 43 is a flow diagram illustrating a multi-stream update in whichthe program data is loaded before the correct destination address issent, according to another embodiment.

STEP 600: Providing first and second storage for recording host dataunits.

STEP 610: Receiving host data.

STEP 620: Loading data as it is being received to data latches used forprogramming the first storage and to data latches used for programmingthe second storage.

STEP 630: Addressing the first or the second storage for recordingdepending on whether or not the received data satisfies a predeterminedcondition.

STEP 640: Programming data to the addressed storage from its datalatches.

STEP 650: End Current Host Write.

Although the invention has been described with respect to variousexemplary embodiments, it will be understood that the invention isentitled to protection within the full scope of the appended claims.

1. A method of recording data from a host comprising: (a) providingfirst and second nonvolatile storages, each for sequentially recordingdata; (b) maintaining at least one index for data in the first andsecond nonvolatile storages; (c) receiving the data from the host; (d)recording the data to the first storage when a predetermined conditionis satisfied; (e) recording to the second storage the data and the atleast one index when the predetermined condition is not satisfied; and(f) repeating (b)-(e) until there are no more data to be recorded.
 2. Amethod as in claim 1, wherein each of the first and second storages isfor storing a block of memory units that are erasable together.
 3. Amethod as in claim 1, wherein: the data from the host is update data fora group of data units; the first storage is for storing said updatedata; and the second storage is for buffering said update data beforebeing transferred to the first storage.
 4. A method as in claim 1,further comprising: organizing the data into data units having apredetermined order; and organizing the first and second nonvolatilestorages into pages, each page for programming together multiple dataunits having predetermined page offsets.
 5. A method as in claim 4,wherein each page is once-programmable after an erase.
 6. A method as inclaim 4, wherein: the predetermined condition is when one of thereceived data units has a page-end offset; and said recording the datato the first storage includes recording to a page of the first storagesaid page-end data unit and any preceding data units in the page.
 7. Amethod as in claim 4, wherein said at least one index is recorded to alocation of a page unoccupied by data in the second storage.
 8. A methodas in claim 4, wherein said at least one index is recorded to a locationof a page having a page-end offset in the second storage.
 9. A method asin claim 4, wherein said recording to the second storage the data andthe at least one index additionally includes recording a pointerpointing to the next recording location of the first storage.
 10. Amethod as in any one of claims 1-9, wherein the first and secondnonvolatile storages are constituted from memory cells that individuallystore one bit of data.
 11. A method as in any one of claims 1-9, whereinthe first and second nonvolatile storages are constituted from memorycells that individually store more than one bit of data.
 12. Anonvolatile memory comprising: a memory organized into a plurality ofblocks, each block being a plurality of memory units that are erasabletogether, each memory unit for storing a logical unit of data; acontroller for controlling operations of said blocks; first and secondblocks, each for sequentially recording data from a host; at least oneindex for data in said first and second nonvolatile storages; a bufferfor receiving the data from the host; and said controller controllingeither recording of the data to said first block when a predeterminedcondition is satisfied, or recording of the data and said at least oneindex to said second block when the predetermined condition is notsatisfied.
 13. A nonvolatile memory as in claim 12, wherein saidnonvolatile memory is in the form of a removable memory card.
 14. Anonvolatile memory as in claim 12, wherein: said data from the host isupdate data for a group of data units; said first block is for storingsaid update data; and said second block is for buffering said updatedata before being transferred to the first block.
 15. A nonvolatilememory as in claim 12, wherein: the data is organized into data unitshaving a predetermined order; and said first and second blocks areorganized into pages, each page for programming together multiple dataunits having predetermined page offsets.
 16. A nonvolatile memory as inclaim 15, wherein each page is once-programmable after an erase.
 17. Anonvolatile memory as in claim 15, wherein: said predetermined conditionis when one of the received data units has a page-end offset; and saidcontroller controlling recording the data to said first block includesrecording to a page of said first block said page-end data unit and anypreceding data units in the page.
 18. A nonvolatile memory as in claim15, wherein said at least one index is recorded to a location of a pageunoccupied by data in said second storage.
 19. A nonvolatile memory asin claim 15, wherein said at least one index is recorded to a locationof a page having a page-end offset in said second storage.
 20. Anonvolatile memory as in claim 15, wherein said controller controllingrecording of the data and said at least one index to said second blockadditionally includes recording a pointer pointing to the next recordinglocation of the first storage.
 21. A nonvolatile memory comprising: amemory organized into a plurality of blocks, each block being aplurality of memory units that are erasable together, each memory unitfor storing a logical unit of data; first and second blocks, each forsequentially recording data from a host; at least one index for data insaid first and second nonvolatile storages; a buffer for receiving thedata from the host; and means for recording either the data to saidfirst block when a predetermined condition is satisfied, or the data andsaid at least one index to said second block when the predeterminedcondition is not satisfied.
 22. A nonvolatile memory as in any one ofclaims 12-21, wherein the first and second nonvolatile storages areconstituted from memory cells that individually store one bit of data.23. A nonvolatile memory as in any one of claims 12-21, wherein saidfirst and second nonvolatile storages are constituted from memory cellsthat individually store more than one bit of data.
 24. A method ofrecording data from a host comprising: providing a nonvolatile memoryorganized into erasable block of memory units, each memory unit forstoring a logical data unit, and each block also organized into one ormore pages, with the memory units in each page having predetermined pageoffsets and being once programmable together after an erase; receivinglogical units of data from a host; providing a block for recording thereceived data; maintaining an index for data in the block; recording thereceived data to the block page by page with the logical data unitsaligned in the page according to their page offsets, and wherein whenthe page to be recorded has a portion unoccupied by data, said recordingincludes recording the index to the unoccupied portion.
 25. A method asin claim 24, wherein the nonvolatile memory is flash EEPROM.
 26. Amethod as in claim 24, wherein: the data from the host is update datafor a group of logical data units; and the block is for storing saidupdate data.
 27. A method as in claim 24, wherein the index is recordedto a location of the page having a page-end offset.
 28. A method as inany one of claims 24-27, wherein the nonvolatile memory is constitutedfrom memory cells that individually store one bit of data.
 29. A methodas in any one of claims 24-27, wherein the nonvolatile memory isconstituted from memory cells that individually store more than one bitof data.
 30. A nonvolatile memory comprising: a nonvolatile memoryorganized into erasable block of memory units, each memory unit forstoring a logical data unit, and each block also organized into one ormore pages, with the memory units in each page having predetermined pageoffsets and being once programmable together after an erase; acontroller for controlling operations of said memory; a buffer forreceiving data from a host; a block for recording the received data; anindex of data in said block; and said controller controlling recordingof the received data to said block page by page with the logical dataunits aligned in the page according to their page offsets, and whereinwhen the page to be recorded has a portion unoccupied by data, saidrecording includes recording the index to the unoccupied portion.
 31. Anonvolatile memory as in claim 30, wherein said nonvolatile memory isflash BEPROM.
 32. A nonvolatile memory as in claim 30, wherein the datafrom the host is update data for a group of logical data units; and saidblock is for storing said update data.
 33. A nonvolatile memory as inclaim 30, wherein said nonvolatile memory is in the form of a removablememory card.
 34. A nonvolatile memory as in claim 30, wherein said indexis recorded to a location of the page having a page-end offset.
 35. Anonvolatile memory comprising: a nonvolatile memory organized intoerasable block of memory units, each memory unit for storing a logicaldata unit, and each block also organized into one or more pages, withthe memory units in each page having predetermined page offsets andbeing once programmable together after an erase; a buffer for receivingdata from a host; a block for recording the received data; an index ofdata in said block; and means for recording the received data to saidblock page by page with the logical data units aligned in the pageaccording to their page offsets, and wherein when the page to berecorded has a portion unoccupied by data, said recording includesrecording the index to the unoccupied portion.
 36. A nonvolatile memoryas in any one of claims 30-35, wherein said nonvolatile memory isconstituted from memory cells that individually store one bit of data.37. A nonvolatile memory as in any one of claims 30-35, wherein saidnonvolatile memory is constituted from memory cells that individuallystore more than one bit of data.